Domanda di colloquio di F5

Manager gave me a algorithm question to solve-

Risposta di colloquio

Anonimo

7 ago 2019

I solved it in iterative but in starting mentioned can be solved with recursion and got stuck for 15 mins and that was my mistake.