• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
April 23, 2024 |290 Views
SDE Sheet - Activity Selection
  Share   Like
Description
Discussion

This video is part of Greedy Algorithms section under GFG SDE Sheet.

In this problem, we are an given N activities with their start and finish day given in array start[ ] and end[ ]. 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 given day.
Note : Duration of the activity includes both starting and ending day.

Example :

Input:
N = 2
start[] = {2, 1}
end[] = {2, 2}
Output: 
1
Explanation:
A person can perform only one of the given activities.

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-
Article: https://www.geeksforgeeks.org/activity-selection-problem-greedy-algo-1/
Problem: https://www.geeksforgeeks.org/problems/activity-selection-1587115620/1
SDE Sheet Link: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

Read More