Leetcode Question 21 Recursive Equation