scores and a passing mark bar. One move deletes a single occurrence of the smallest value in the array.
How many moves does it take until every remaining result is at least bar?scores=[40, 75, 12, 90, 60], bar=60 → 2
Remove 12, then 40; what is left is 75, 90 and 60, all at least 60. Two moves.
scores=[8, 8, 9], bar=8 → 0
Every value is already at least 8, so nothing has to go.
scores=[3, 1, 4, 1, 5], bar=5 → 4
barscores=[40, 75, 12, 90, 60], bar=60
2
Run checks the first 3 tests in your browser. Submit checks all 101 tests on the server, hidden ones included.