@@ -0,0 +1,1149 @@
+package com.github.conradoqg.studydsa.hackerrank.challenges.ctci;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Scanner;%0A%0Apublic class DavisStaircase %7B%0A    private static HashMap%3CInteger, Integer%3E cache = new HashMap%3CInteger, Integer%3E();%0A%0A    private static int calculateCombinatoryFor(int n) %7B%0A        int ways = 0;%0A        if (n == 1)%0A            ways = 1;%0A        if (n == 2)%0A            ways = 2;%0A        if (n == 3)%0A            ways = 4;%0A%0A        if (n %3E 3) %7B%0A            for (int i = 1; i %3C= 3; i++) %7B%0A                if (cache.containsKey(n - i))%0A                    ways += cache.get(n - i);%0A                else %7B%0A                    int result = calculateCombinatoryFor(n - i);%0A                    ways += result;%0A                    cache.put(n - i, result);%0A                %7D%0A            %7D%0A        %7D%0A%0A        return ways;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        try (Scanner in = new Scanner(System.in)) %7B%0A            int s = in.nextInt();%0A            for (int a0 = 0; a0 %3C s; a0++) %7B%0A                int n = in.nextInt();%0A                System.out.println(calculateCombinatoryFor(n));%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add Davis' staircase CTCI challenge