title: Sum Matrix Element Absolute Difference Row Column Numbers 2
signature: function sum_matrix_element_absolute_difference_row_column_numbers_2(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(12, 572);
      @printf("TEST-0...%s\n",result);
      
      result = driver(89, 234960);
      @printf("TEST-1...%s\n",result);
      
      result = driver(76, 146300);
      @printf("TEST-2...%s\n",result);
      
      result = driver(2, 2);
      @printf("TEST-3...%s\n",result);
      
      result = driver(81, 177120);
      @printf("TEST-4...%s\n",result);
      
      result = driver(11, 440);
      @printf("TEST-5...%s\n",result);
      
      result = driver(26, 5850);
      @printf("TEST-6...%s\n",result);
      
      result = driver(35, 14280);
      @printf("TEST-7...%s\n",result);
      
      result = driver(16, 1360);
      @printf("TEST-8...%s\n",result);
      
      result = driver(66, 95810);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
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;
  }