title: Sum Matrix Element Absolute Difference Row Column Numbers
signature: func sumMatrixElementAbsoluteDifferenceRowColumnNumbers(n int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(60, 71980)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(44, 28380)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(72, 124392)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(90, 242970)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(99, 323400)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(45, 30360)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(27, 6552)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(11, 440)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(65, 91520)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(52, 46852)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def sum_matrix_element_absolute_difference_row_column_numbers(n):
      arr = [[0 for x in range(n)] for y in range(n)]
      for i in range(n):
          for j in range(n):
              arr[i][j] = abs((i - j))
      sum = 0
      for i in range(n):
          for j in range(n):
              sum += arr[i][j]
      return sum
source_cpp: int sum_matrix_element_absolute_difference_row_column_numbers(int n) {
    int arr [ n ] [ n ];
    for ( int i = 0;
    i < n;
    i ++ ) for ( int j = 0;
    j < n;
    j ++ ) arr [ i ] [ j ] = abs ( i - j );
    int sum = 0;
    for ( int i = 0;
    i < n;
    i ++ ) for ( int j = 0;
    j < n;
    j ++ ) sum += arr [ i ] [ j ];
    return sum;
  }