Recursive Staircase Problem (retired)
Description:
Recursive Staircase Problem.
(you can also solve it iteratively, with dynamic programming and so on...) ___________ _/ _/ ____/
Description:
given the height of a staircase, and a set of different step sizes, find out the total number of ways you can climb the staircase.
here is the link to find out more: https://www.hackerrank.com/challenges/ctci-recursive-staircase/problem
Mathematical problem definition:
Given an int n in the natural numbers, and a set X={x1,x2,...} natural numbers,
figure out the number of distinct sequences of the numbers in X such that each of your sequences ay(n), {1...c}->X fulfills
(sum from m=1 to c of ay(m)) = n
in essence, you just have to find the number of ways you can climb n stairs given your |X| different legs of lengths [x1,...]
Example: n=3;X={1,2} solution: [1,1,1],[1,2],[2,1], returning: 3 (there are 3 ways)
happy coding!
Similar Kata:
Stats:
Created | Jun 6, 2018 |
Warriors Trained | 46 |
Total Skips | 0 |
Total Code Submissions | 23 |
Total Times Completed | 5 |
Haskell Completions | 2 |
Java Completions | 4 |
Total Stars | 1 |
% of votes with a positive feedback rating | 25% of 4 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 4 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |