Why are you using ans= min(ans,mid) in the program?

Mid is the exact ans we get through binary search then what is the use of using min() in this program

hi @priya_Jainyes you can directly say ans = mid also because our search space will always get smaller, so there is no chance that mid could be bigger than the curr ans.

https://ide.codingblocks.com/s/282630 I don’t get it why this code is not working

@priya_Jain see the problem is your variable names.
Your s means number of students, but later it also means start of search space. So use separate variable names for both purposes