Skip to content

Commit c751817

Browse files
authored
Create Staircase
1 parent 91d3ed1 commit c751817

File tree

1 file changed

+23
-0
lines changed
  • Course 2 - Data Structures in JAVA/Recursion Assignment

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
A child is running up a staircase with N steps, and can hop either 1 step, 2 steps or 3 steps at a time.
3+
Implement a method to count how many possible ways the child can run up to the stairs. You need to return number of possible ways W.
4+
5+
Input format :
6+
Integer N
7+
8+
Output Format :
9+
Integer W
10+
11+
Constraints :
12+
1 <= N <= 30
13+
14+
Sample Input 1 :
15+
4
16+
Sample Output 1 :
17+
7
18+
19+
Sample Input 2 :
20+
5
21+
Sample Output 2 :
22+
13
23+
*/

0 commit comments

Comments
 (0)