title: Sum Matrix Element Absolute Difference Row Column Numbers
signature: class Solution {
  
      public Integer sumMatrixElementAbsoluteDifferenceRowColumnNumbers(Integer n) {
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;
  }
question_info.extension: java
question_info.entry_fn_name: sumMatrixElementAbsoluteDifferenceRowColumnNumbers
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 71980, "inputs": {"n": 60}}, {"idx": 1, "outputs": 28380, "inputs": {"n": 44}}, {"idx": 2, "outputs": 124392, "inputs": {"n": 72}}, {"idx": 3, "outputs": 242970, "inputs": {"n": 90}}, {"idx": 4, "outputs": 323400, "inputs": {"n": 99}}, {"idx": 5, "outputs": 30360, "inputs": {"n": 45}}, {"idx": 6, "outputs": 6552, "inputs": {"n": 27}}, {"idx": 7, "outputs": 440, "inputs": {"n": 11}}, {"idx": 8, "outputs": 91520, "inputs": {"n": 65}}, {"idx": 9, "outputs": 46852, "inputs": {"n": 52}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(60, 71980);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(44, 28380);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(72, 124392);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(90, 242970);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(99, 323400);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(45, 30360);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(27, 6552);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(11, 440);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(65, 91520);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(52, 46852);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__