Leetcode Question 21 Recursive Algorithm