Rishabh Kholiya's submission of The Smallest Pair | CodeChef

Hey ,Can someone please tell me why codechef is not accepting my code??

It is Smallest Pair problem.

  1. You are not updating the min value across multiple test-cases
  2. The min value should be 2 \times10^6 as the maximum value sum of 2 elements can attain is 2\times10^6 your partially correct sub-optimal code

TLE on larger test-cases is 'cause your solution is not optimal, try to reduce the complexity to O(N) (but O(NlogN) would also suffice)

1 Like

Why it is not working for the fourth constraint???

It is showing a TLE which means your solution is not fast enough to pass all test-cases

1 Like