Visa Inc. interview question

One LC hard question, then coding pair was a LC medium with recursion