Skip to content

Latest commit

 

History

History

Count of Different Ways to Express N As The Sum of 1, 3 And 4

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Given N, count the number of ways to express N as sum of 1, 3 and 4.

Input :  N = 4
Output : 4 
Explanation: 1+1+1+1 
             1+3
             3+1 
             4 

Input : N = 5 
Output : 6
Explanation: 1 + 1 + 1 + 1 + 1
             1 + 4
             4 + 1
             1 + 1 + 3
             1 + 3 + 1
             3 + 1 + 1