1.Activity Selection
Given N activities with their start and finish times. Select the maximum number of activities that can be performed by a single person, assuming that a person can only work on a single activity at a time.
Note : The start time and end time of two activities may coincide.
Example 1:
Example 2:
Solution:
Approach: Sort the array on basis of ending time Select from the first and check if a activity coincides or not
Time Complexity: O(N log N)
Last updated