I can’t pass 2 test cases can you please tell where I am going wrong
Code:
I can’t pass 2 test cases can you please tell where I am going wrong
Code:
Hello @haseebshaik00
please do this question with the help of for loop .
i have made the correction https://ide.codingblocks.com/s/321930.
if you feel your doubt has been resolved please mark this as resolved.
Happy Learning !!
Hi @tusharaggarwal272,
Thanks for the solution.
But I did the calculation part in O(n) time using while loop only.
Code Link:
@haseebshaik00 your anwswer is coming wrong with this approach .
it is the basic question just for checking your knowledge about break statement and loops .
your answer is coming out to be wrong because your iterator are not pointing to the correct locations .
here is the link for the prateek bhaiya’s video for the better understanding of the concept.
https://www.youtube.com/watch?v=3J1tAsoZ7-g.
and you should do the dry run of the code in order to understand where yor code is doing wrong .
for better understanding take help of this .
I Hope i’ve cleared your doubt .
Happy Learning!
hey @haseebshaik00 as you are not responding to the doubt above i hope your doubt is cleared and you can now mark this doubt as resolved and do hit the like button.
Happy Learning !!
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.