title: Sum Of All Elements Up To Nth Row In A Pascals Triangle
signature: pub fn sum_of_all_elements_up_to_nth_row_in_a_pascals_triangle(n: i32) -> i64 {
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: i64, expected: i64)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i64)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        21, 
        2097151
      ));
      
      println!("TEST-1...{}", driver(
        4, 
        15
      ));
      
      println!("TEST-2...{}", driver(
        31, 
        2147483647
      ));
      
      println!("TEST-3...{}", driver(
        38, 
        274877906943
      ));
      
      println!("TEST-4...{}", driver(
        36, 
        68719476735
      ));
      
      println!("TEST-5...{}", driver(
        32, 
        4294967295
      ));
      
      println!("TEST-6...{}", driver(
        23, 
        8388607
      ));
      
  }
source_py: def sum_of_all_elements_up_to_nth_row_in_a_pascals_triangle(n):
      sum = 0
      for row in range(n):
          sum = (sum + (1 << row))
      return sum
source_cpp: long long int sum_of_all_elements_up_to_nth_row_in_a_pascals_triangle(int n) {
    long long int sum = 0;
    for ( int row = 0;
    row < n;
    row ++ ) {
      sum = sum + ( 1 << row );
    }
    return sum;
  }