Can anyone write editorial for this Topcoder problem. What is approach to solve this kind of problem.

This problem can be solved with a **greedy** algorithm.

First, find the *earliest* interval *less than or equal to* 1 second that contains 3 judges scoring a hit.

Next, remove all hits that occur during that interval or before it, and repeat.

This works because if you can get N hits by time t, that is always better than getting N hits by time t+1.

Hope this helps !

2 Likes