title: Sum Binomial Coefficients
signature: long long sumBinomialCoefficients(int n) {
test_code: #include <algorithm>
  #include <assert.h>
  #include <cstdlib>
  #include <iostream>
  #include <map>
  #include <set>
  #include <string>
  #include <tuple> 
  #include <unordered_map>
  #include <vector>
  #include <math.h>
  #include <cmath>
  #include <bits/stdc++.h>
  #include <numeric>
  #include <functional>
  
  using namespace std;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(long long actual, long long expected){
      return actual == expected;
  }
  
  string driver(int n, long long expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }
      catch (const std::overflow_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::runtime_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::exception& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (...)
      {
          return "UNK_ERROR";
      }
  }
  
  int main() {
      string result = "";
  
      result = driver(8, 256); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver(39, 549755813888); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver(25, 33554432); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver(44, 17592186044416); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver(6, 64); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver(48, 281474976710656); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver(39, 549755813888); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
source_py: def sum_binomial_coefficients(n):
      C = [([0] * (n + 2)) for i in range(0, (n + 2))]
      for i in range(0, (n + 1)):
          for j in range(0, (min(i, n) + 1)):
              if ((j == 0) or (j == i)):
                  C[i][j] = 1
              else:
                  C[i][j] = (C[(i - 1)][(j - 1)] + C[(i - 1)][j])
      sum = 0
      for i in range(0, (n + 1)):
          sum += C[n][i]
      return sum
source_cpp: int sum_binomial_coefficients(int n) {
    int C [ n + 1 ] [ n + 1 ];
    for ( int i = 0;
    i <= n;
    i ++ ) {
      for ( int j = 0;
      j <= min ( i, n );
      j ++ ) {
        if ( j == 0 || j == i ) C [ i ] [ j ] = 1;
        else C [ i ] [ j ] = C [ i - 1 ] [ j - 1 ] + C [ i - 1 ] [ j ];
      }
    }
    int sum = 0;
    for ( int i = 0;
    i <= n;
    i ++ ) sum += C [ n ] [ i ];
    return sum;
  }