[HACKERRANK] - Recursion: Davis' Staircase
www.hackerrank.com/challenges/ctci-recursive-staircase/problem Recursion: Davis' Staircase | HackerRank Find the number of ways to get from the bottom of a staircase to the top if you can jump 1, 2, or 3 stairs at a time. www.hackerrank.com 한 번에 1, 2, 3칸씩 계단을 오를 수 있을 때, 계단을 오르는 모든 경우의 수의 개수를 구하는 문제. 계단 수 n, 경우의 수 f(n) f(1) = [1] f(2) = [11, 2] f(3) = [111, 12, 21, 3] 계단이 4개 이상일 때 부터는 오를 수 있는 칸 수..
2021. 2. 3.