title: Sum Of All Elements Up To Nth Row In A Pascals Triangle
signature: class Solution {
  
      public Long sumOfAllElementsUpToNthRowInAPascalsTriangle(Integer n) {
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;
  }
question_info.extension: java
question_info.entry_fn_name: sumOfAllElementsUpToNthRowInAPascalsTriangle
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 2097151, "inputs": {"n": 21}}, {"idx": 1, "outputs": 15, "inputs": {"n": 4}}, {"idx": 2, "outputs": 2147483647, "inputs": {"n": 31}}, {"idx": 3, "outputs": 274877906943, "inputs": {"n": 38}}, {"idx": 4, "outputs": 68719476735, "inputs": {"n": 36}}, {"idx": 5, "outputs": 4294967295, "inputs": {"n": 32}}, {"idx": 6, "outputs": 8388607, "inputs": {"n": 23}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Long expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(21, 2097151L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(4, 15L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(31, 2147483647L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(38, 274877906943L);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(36, 68719476735L);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(32, 4294967295L);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(23, 8388607L);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Long expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Long actual, Long expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6
question_info.commands: java __FILENAME__