Why wrong answer only in one test case

in my code -“https://ide.codingblocks.com/s/79045” it is wrong for one test case ,but in the soluion -“https://ide.codingblocks.com/s/79046” which i’ve seen from Discussion of coding blocks it’s correct for all the cases.

hey Ayush, place your ans after while loop and that should be ans=e not ans=mid-1

In your soluton I have following doubts -“https://ide.codingblocks.com/s/79326” why you have taken e as 1000000 and why you’ve taken mas (s+e+1)/2 ans why s=m? Please Answer them

hey @Ayusinha, we have e to such a value according to constraints given in the question.

It is (s+e+1)/2 beacuse s is strating from 1 not from zero.

s=m because we are considering other side when else case gets failed.

Please free to ask in case of any doubt, sorry for late reply now it will earliest as possible.