title: Sum Matrix Element Absolute Difference Row Column Numbers 2
signature: pub fn sum_matrix_element_absolute_difference_row_column_numbers_2(n: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        12, 
        572
      ));
      
      println!("TEST-1...{}", driver(
        89, 
        234960
      ));
      
      println!("TEST-2...{}", driver(
        76, 
        146300
      ));
      
      println!("TEST-3...{}", driver(
        2, 
        2
      ));
      
      println!("TEST-4...{}", driver(
        81, 
        177120
      ));
      
      println!("TEST-5...{}", driver(
        11, 
        440
      ));
      
      println!("TEST-6...{}", driver(
        26, 
        5850
      ));
      
      println!("TEST-7...{}", driver(
        35, 
        14280
      ));
      
      println!("TEST-8...{}", driver(
        16, 
        1360
      ));
      
      println!("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;
  }