I am not able to go from arr[n-1] to arr[0] please help to rectify it.
C B ide is not opening I have submitted the code kindly take the code from there.
Doubt in circular array
@supratik260699 hey the array is not actually circular, but you need to treat is as circular for calculating the answer.
You cannot do n-1 ++ to get to 0.
Though you can do one thing. after incrementing the counter take its mod by n, this way you counter will move from 0 1 2 …n-1 0 1 2 …
Just make sure you place right exit condition so that you do not get stuck in infinite loop.
If this resolves your doubt mark it as resolved.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.