Retired

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!

Algorithms
Recursion
Computability Theory
Logic
Theoretical Computer Science

Stats:

CreatedJun 6, 2018
Warriors Trained46
Total Skips0
Total Code Submissions23
Total Times Completed5
Haskell Completions2
Java Completions4
Total Stars1
% of votes with a positive feedback rating25% of 4
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes2
Total Rank Assessments4
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • pointbazaar Avatar
Ad