Quantum-Si interview question

Solve this recursive problem, let me watch.