This is a classic recursion problem. We can identify these types by going over a few example cases by hand. This is typically a useful practice to get into regardless since it can help with debugging and solving edge cases.
This is marked as a Medium Problem. In practice, it is around the low end of medium. Problems such as this require an understanding…
Keep reading with a 7-day free trial
Subscribe to Technology Made Simple to keep reading this post and get 7 days of free access to the full post archives.