title: Sum Of All Elements Up To Nth Row In A Pascals Triangle 1
signature: function sumOfAllElementsUpToNthRowInAPascalsTriangle1(n: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(53, 9007199254740991);
    console.log(`TEST-0...${result}`);
  
    result = driver(3, 7);
    console.log(`TEST-1...${result}`);
  
    result = driver(28, 268435455);
    console.log(`TEST-2...${result}`);
  
    result = driver(44, 17592186044415);
    console.log(`TEST-3...${result}`);
  
    result = driver(46, 70368744177663);
    console.log(`TEST-4...${result}`);
  
    result = driver(3, 7);
    console.log(`TEST-5...${result}`);
  
    result = driver(16, 65535);
    console.log(`TEST-6...${result}`);
  
  };
  
  main();
source_py: def sum_of_all_elements_up_to_nth_row_in_a_pascals_triangle_1(n):
      sum = 0
      sum = (1 << n)
      return (sum - 1)
source_cpp: long long int sum_of_all_elements_up_to_nth_row_in_a_pascals_triangle_1(int n) {
    long long int sum = 0;
    sum = 1 << n;
    return ( sum - 1 );
  }