News
Hi Karan, I used iteration to solve the problem instead of using recursion. I think it gives better performance. It's only O(n). Thank you for your time.
Iteration can be used to perform tasks that require multiple steps or calculations, such as finding the nth term of the Fibonacci sequence. Add your perspective Help others by sharing more (125 ...
Results that may be inaccessible to you are currently showing.
Hide inaccessible results