title: Sum Matrix Element Absolute Difference Row Column Numbers 1
signature: sumMatrixElementAbsoluteDifferenceRowColumnNumbers1(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(
          63, 
          83328)
      }");
  
      print("TEST-1...${driver(
          72, 
          124392)
      }");
  
      print("TEST-2...${driver(
          28, 
          7308)
      }");
  
      print("TEST-3...${driver(
          35, 
          14280)
      }");
  
      print("TEST-4...${driver(
          6, 
          70)
      }");
  
      print("TEST-5...${driver(
          70, 
          114310)
      }");
  
      print("TEST-6...${driver(
          20, 
          2660)
      }");
  
      print("TEST-7...${driver(
          8, 
          168)
      }");
  
      print("TEST-8...${driver(
          8, 
          168)
      }");
  
      print("TEST-9...${driver(
          35, 
          14280)
      }");
  
      return 0;
  }
source_py: def sum_matrix_element_absolute_difference_row_column_numbers_1(n):
      sum = 0
      for i in range(n):
          sum += (i * (n - i))
      return (2 * sum)
source_cpp: int sum_matrix_element_absolute_difference_row_column_numbers_1(int n) {
    int sum = 0;
    for ( int i = 0;
    i < n;
    i ++ ) sum += i * ( n - i );
    return 2 * sum;
  }