Murthai Parathas Doubt (not passing just 2 testcases)

It is not passing 2 testcases. But passing all other than it. Please look into it.

@adarsh_2001 hey just correct few mistakes

  1. make ans = inf and ans = min(ans , mid)
  2. 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.

@adarsh_2001 good :+1: :+1: :+1: :+1:

1 Like