title: Count Ofdifferent Ways Express N Sum 1 3 4
signature: count_ofdifferent_ways_express_n_sum_1_3_4 <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          44L, 
          821223649L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          9L, 
          40L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          19L, 
          4895L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          10L, 
          64L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          78L, 
          10472279279564025L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          70L, 
          222915410843904L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          81L, 
          44361286907595736L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          81L, 
          44361286907595736L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          49L, 
          9107509825L
      )))
  
  }
  
  main()
source_py: def count_ofdifferent_ways_express_n_sum_1_3_4(n):
      DP = [0 for i in range(0, (n + 1))]
      DP[0] = DP[1] = DP[2] = 1
      DP[3] = 2
      for i in range(4, (n + 1)):
          DP[i] = ((DP[(i - 1)] + DP[(i - 3)]) + DP[(i - 4)])
      return DP[n]
source_cpp: int count_ofdifferent_ways_express_n_sum_1_3_4(int n) {
    int DP [ n + 1 ];
    DP [ 0 ] = DP [ 1 ] = DP [ 2 ] = 1;
    DP [ 3 ] = 2;
    for ( int i = 4;
    i <= n;
    i ++ ) DP [ i ] = DP [ i - 1 ] + DP [ i - 3 ] + DP [ i - 4 ];
    return DP [ n ];
  }