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

# Activity selection problem on topcoder

**sarvagya3943**#2

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 !