Saturday, July 8, 2017

BUSYMAN SPOJ Greedy C

Algorithm:

1. Sort on end times.
2. Iterate over sorted list
        2.1 If the current activity overlaps, skip it
        2.2 If it doesn't increase count of answer. Set new time to end time of this activity.

Code: 

Friday, July 7, 2017