title: Maximum Number 2X2 Squares Can Fit Inside Right Isosceles Triangle
signature: function maximum_number_2x2_squares_can_fit_inside_right_isosceles_triangle(base_arg0)
source_py: def maximum_number_2x2_squares_can_fit_inside_right_isosceles_triangle(base):
      base = (base - 2)
      base = (base / 2)
      return ((base * (base + 1)) / 2)
source_cpp: int maximum_number_2x2_squares_can_fit_inside_right_isosceles_triangle(int base) {
    base = ( base - 2 );
    base = base / 2;
    return base * ( base + 1 ) / 2;
  }
question_info.entry_fn_name: maximum_number_2x2_squares_can_fit_inside_right_isosceles_triangle
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return math.abs(actual - expected) < 1e-06
  end
  
  function driver(base_arg0, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(base_arg0) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(95, 1104.375)
      print(string.format("TEST-0...%s",result))
  
      result = driver(49, 287.875)
      print(string.format("TEST-1...%s",result))
  
      result = driver(10, 10.0)
      print(string.format("TEST-2...%s",result))
  
      result = driver(73, 647.875)
      print(string.format("TEST-3...%s",result))
  
      result = driver(74, 666.0)
      print(string.format("TEST-4...%s",result))
  
      result = driver(40, 190.0)
      print(string.format("TEST-5...%s",result))
  
      result = driver(10, 10.0)
      print(string.format("TEST-6...%s",result))
  
      result = driver(94, 1081.0)
      print(string.format("TEST-7...%s",result))
  
      result = driver(64, 496.0)
      print(string.format("TEST-8...%s",result))
  
      result = driver(16, 28.0)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": 1104.375, "inputs": {"base_arg0": 95}}, {"idx": 1, "outputs": 287.875, "inputs": {"base_arg0": 49}}, {"idx": 2, "outputs": 10.0, "inputs": {"base_arg0": 10}}, {"idx": 3, "outputs": 647.875, "inputs": {"base_arg0": 73}}, {"idx": 4, "outputs": 666.0, "inputs": {"base_arg0": 74}}, {"idx": 5, "outputs": 190.0, "inputs": {"base_arg0": 40}}, {"idx": 6, "outputs": 10.0, "inputs": {"base_arg0": 10}}, {"idx": 7, "outputs": 1081.0, "inputs": {"base_arg0": 94}}, {"idx": 8, "outputs": 496.0, "inputs": {"base_arg0": 64}}, {"idx": 9, "outputs": 28.0, "inputs": {"base_arg0": 16}}]