Codeforces question

I couldn’t understand the question can anyone explain it

You can call multiple person at a time and there should be >=a[i] person in the court when i’th person arrived. So just sort the array and set the result==n. Iterate array from backward and if a[i]>result decrease the result by one. At last print result+1.

1 Like