Are we allowed recursion?


#1

Are we allowed recursion?


#2

Yes, I was able to solve through iterative as well as recursion approach


#3

@guest_user_251
We can use recursion, But due to the context switching time. it will take more time and memory than the iterative approach.
Therefore it is recommended to use the iterative approach. that will give you correct answer in right time
Regards
Hitesh