title: Sum Matrix Element Absolute Difference Row Column Numbers 1
signature: def sumMatrixElementAbsoluteDifferenceRowColumnNumbers1(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        63, 
        83328    
      )}")   
  
  
      println(s"TEST-1...${driver(
        72, 
        124392    
      )}")   
  
  
      println(s"TEST-2...${driver(
        28, 
        7308    
      )}")   
  
  
      println(s"TEST-3...${driver(
        35, 
        14280    
      )}")   
  
  
      println(s"TEST-4...${driver(
        6, 
        70    
      )}")   
  
  
      println(s"TEST-5...${driver(
        70, 
        114310    
      )}")   
  
  
      println(s"TEST-6...${driver(
        20, 
        2660    
      )}")   
  
  
      println(s"TEST-7...${driver(
        8, 
        168    
      )}")   
  
  
      println(s"TEST-8...${driver(
        8, 
        168    
      )}")   
  
  
      println(s"TEST-9...${driver(
        35, 
        14280    
      )}")   
  
  }
  
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;
  }