It is not passing 2 testcases. But passing all other than it. Please look into it.
Murthai Parathas Doubt (not passing just 2 testcases)
@adarsh_2001 hey just correct few mistakes
- make ans = inf and ans = min(ans , mid)
- take x = 1 in checker function;
Hey, Thank you. But can you please give a testcase, for which my previous ans would fail.
@adarsh_2001 this is the test case
999
10 1 3 2 4 2 4 8 7 6 5
your output = 16381
expected output = 16380
Thank You. Got my mistake. I wasn’t doing (s<=e) in the while condition. due to which it was giving a just greater ans than the required one.