Computer Science, Mathematics, Learning, Learning To Code, Code.
Arrays.fill(memo, -1); return helper(n, memo); } public int helper(int n, int[] memo) { if (n <= 1) { return n; } if (memo[n] != -1) { return memo[n]; } memo[n] = helper(n - 1, memo) + helper(n - 2, memo); return memo[n]; } Personally, I always like to have some sort of helper function complete the