Problem on BINARR

solution no 37390637 giving me wrong ans in second subtask but when i had seen the solution of some other guy solution no 37367592 they had just sorted the array in descending order then they are checking length but my doubt is why they are doing sorting to find the ans as sorting may result in disorder the subarray.

THOSE SOLUTIONS ARE INCORRECT:

TESTCASE:
5 1 19
10 3 1 2 10

SORTING OUTPUT: 2
CORRECT OUTPUT: 5

PS: TEST DATA IS VERY WEAK FOR THAT PROBLEM.

CORRECT APPROACH: BINARY SEARCH ON SIZE OF S