title: Count Ofdifferent Ways Express N Sum 1 3 4
signature: class Solution {
  
      public Long countOfdifferentWaysExpressNSum134(Integer n) {
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(44, 821223649L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(9, 40L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(19, 4895L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(10, 64L);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(78, 10472279279564025L);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(70, 222915410843904L);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(81, 44361286907595736L);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(81, 44361286907595736L);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(49, 9107509825L);
          System.out.println(String.format("%s%s","TEST-8...",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
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 ];
  }