Leetcode Problem Solution Code Example Of A Recursive Method