Uber interview question

LeetCode medium - interviewer help w/ base cases