Code -https://ide.codingblocks.com/s/246425
According to me there is some issue in the line 32, as if I put len>=maxLen then test case 0 ,1 work and rest cases don’t work but if i write len>maxlen then only test case 0 gives wrong answer.
One of my test case not giving correct answer
@7nishit line 32 is correct, when k=0 and all the array values are 0 then as per line 43 i>=L it will print 1 but you cant print 1 cause k=0 so you haven’t flip any 0 so it will give you wrong answer in this case.
updating line 43 as
if(L!=0 and i>=L and i<=R) will work fine.