Why is my code not working?


Unable to find error

@goyalvivek hii vivek check this is it working or not

@goyalvivek in your code if u do a[ind]-1 then it will not working as u dry run your code in tc 3,4,-1,1 here at last ind=0+1 then 1 is answer but ans is 2 and the test case 1,2,0 here all the value is zero according to your code

Its time complexity is n*log n , can it be done in On ?

Unable to clr 2nd testcase https://ide.codingblocks.com/s/655696

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.