title: Sum Of All Elements Up To Nth Row In A Pascals Triangle
signature: def sumOfAllElementsUpToNthRowInAPascalsTriangle(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Long , expected: Long): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, expected: Long): 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(
        21, 
        2097151L    
      )}")   
  
  
      println(s"TEST-1...${driver(
        4, 
        15L    
      )}")   
  
  
      println(s"TEST-2...${driver(
        31, 
        2147483647L    
      )}")   
  
  
      println(s"TEST-3...${driver(
        38, 
        274877906943L    
      )}")   
  
  
      println(s"TEST-4...${driver(
        36, 
        68719476735L    
      )}")   
  
  
      println(s"TEST-5...${driver(
        32, 
        4294967295L    
      )}")   
  
  
      println(s"TEST-6...${driver(
        23, 
        8388607L    
      )}")   
  
  }
  
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;
  }