title: Sum Matrix Element Absolute Difference Row Column Numbers 2
signature: def sumMatrixElementAbsoluteDifferenceRowColumnNumbers2(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(
        12, 
        572    
      )}")   
  
  
      println(s"TEST-1...${driver(
        89, 
        234960    
      )}")   
  
  
      println(s"TEST-2...${driver(
        76, 
        146300    
      )}")   
  
  
      println(s"TEST-3...${driver(
        2, 
        2    
      )}")   
  
  
      println(s"TEST-4...${driver(
        81, 
        177120    
      )}")   
  
  
      println(s"TEST-5...${driver(
        11, 
        440    
      )}")   
  
  
      println(s"TEST-6...${driver(
        26, 
        5850    
      )}")   
  
  
      println(s"TEST-7...${driver(
        35, 
        14280    
      )}")   
  
  
      println(s"TEST-8...${driver(
        16, 
        1360    
      )}")   
  
  
      println(s"TEST-9...${driver(
        66, 
        95810    
      )}")   
  
  }
  
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;
  }