title: Triangular Matchstick Number
signature: class Solution {
  
      public Float triangularMatchstickNumber(Integer x) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer x, Float expected){
          try{
              Driver driver = new Driver();
              if (driver.run(x,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(6, 63.0f);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(25, 975.0f);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(15, 360.0f);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(30, 1395.0f);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(17, 459.0f);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(80, 9720.0f);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(27, 1134.0f);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(13, 273.0f);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(12, 234.0f);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(67, 6834.0f);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer x, Float expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(x),expected);
      }
      
      public boolean validateSolution(Float actual, Float expected){
          return Math.abs(actual - expected) < 1e-06f;
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def triangular_matchstick_number(x):
      return (((3 * x) * (x + 1)) / 2)
source_cpp: int triangular_matchstick_number(int x) {
    return ( 3 * x * ( x + 1 ) ) / 2;
  }