Pergunta de entrevista da empresa Visa Inc.

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