diff options
| -rw-r--r-- | the-grandest-staircase-of-them-all/Solution.java | 8 | ||||
| -rw-r--r-- | the-grandest-staircase-of-them-all/solution.py | 7 | 
2 files changed, 10 insertions, 5 deletions
diff --git a/the-grandest-staircase-of-them-all/Solution.java b/the-grandest-staircase-of-them-all/Solution.java index 1556936..9bcc338 100644 --- a/the-grandest-staircase-of-them-all/Solution.java +++ b/the-grandest-staircase-of-them-all/Solution.java @@ -1,5 +1,5 @@ -public class Solution { -    public static int solution(int n) { -        // Your code here -    } +public class Solution { +  public static int solution(int n) { +    // Your code here +  }  } diff --git a/the-grandest-staircase-of-them-all/solution.py b/the-grandest-staircase-of-them-all/solution.py index 744b41d..d4e5499 100644 --- a/the-grandest-staircase-of-them-all/solution.py +++ b/the-grandest-staircase-of-them-all/solution.py @@ -1,2 +1,7 @@  def solution(n): -  # Your code here +    t = [1] + [0]*n +    for s in range(1, n + 1): +        for h in range(n, s - 1, -1): +            t[h] += t[h - s] + +    return t[-1] - 1  | 
