title: Sum Matrix Element Absolute Difference Row Column Numbers 2
signature: sumMatrixElementAbsoluteDifferenceRowColumnNumbers2(n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(n, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          12, 
          572)
      }");
  
      print("TEST-1...${driver(
          89, 
          234960)
      }");
  
      print("TEST-2...${driver(
          76, 
          146300)
      }");
  
      print("TEST-3...${driver(
          2, 
          2)
      }");
  
      print("TEST-4...${driver(
          81, 
          177120)
      }");
  
      print("TEST-5...${driver(
          11, 
          440)
      }");
  
      print("TEST-6...${driver(
          26, 
          5850)
      }");
  
      print("TEST-7...${driver(
          35, 
          14280)
      }");
  
      print("TEST-8...${driver(
          16, 
          1360)
      }");
  
      print("TEST-9...${driver(
          66, 
          95810)
      }");
  
      return 0;
  }
source_py: def sum_matrix_element_absolute_difference_row_column_numbers_2(n):
      n -= 1
      sum = 0
      sum += ((n * (n + 1)) / 2)
      sum += (((n * (n + 1)) * ((2 * n) + 1)) / 6)
      return int(sum)
source_cpp: int sum_matrix_element_absolute_difference_row_column_numbers_2(int n) {
    n --;
    int sum = 0;
    sum += ( n * ( n + 1 ) ) / 2;
    sum += ( n * ( n + 1 ) * ( 2 * n + 1 ) ) / 6;
    return sum;
  }