1 Count problem

Why I am getting 7 as max length instead of 5 ?

@vaishnavtannu There were some errors in the flow. https://ide.codingblocks.com/s/253552 Have a look at this it is working now.

The code that you have provided is also giving 7 instead of 5 for the sample testcase.

Actually the things which I edited got lost because of not saving . Can you please have a look at this.https://ide.codingblocks.com/s/253574

Yes, I checked again but still getting 7. Also I can see the only change that is being made in the code is
if(max_len< r-l+1){
max_len = max(max_len, r-l+1);
cout<<l<<" "<<r<<endl;

I did several other changes these were the first few changes. I hope you can solve this problem now

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.