Visa Inc. Interview Question

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