@@ -0,0 +1,886 @@
+package mylab.puzzles;%0A%0A/**%0A * Fibonacci%0A *%0A * Fibonacci calculation using Map%3CInteger,Integer%3E as cache%0A *%0A * Indra Gunawan - March 23, 2017%0A */%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class Fibonacci %7B%0A%0A    public int solve(int N) %7B%0A        Map%3CInteger,Integer%3E cache = new HashMap%3C%3E();%0A        cache.put(0,0);%0A        cache.put(1,1);%0A        return _solve(N, cache);%0A    %7D%0A%0A    public int _solve(int N, Map%3CInteger,Integer%3E cache) %7B%0A        if (!cache.containsKey(N)) %7B%0A            int val = _solve(N-1, cache) + _solve(N - 2, cache);%0A            cache.put(N, val);%0A        %7D%0A        return cache.get(N);%0A    %7D%0A%0A    public static void main(String args%5B%5D) throws Exception %7B%0A        Fibonacci problem = new Fibonacci();%0A        System.out.println(problem.solve(2));%0A        System.out.println(problem.solve(3));%0A        System.out.println(problem.solve(4));%0A    %7D%0A%0A%7D%0A

Add puzzle Fibonacci with a cache