I dont get what approach we have to apply

i dont get what approach we have to apply

Sort the activities in the increasing order of ending times and then do a single traversal and pick up activities greedily, i.e, choose an activity whenever possible.
You can refer this article https://www.geeksforgeeks.org/activity-selection-problem-greedy-algo-1/

Plz write code for this

We cannot directly share the code. Please try it on your own following the approach mentioned above. If you face any problem with your code then you can save it on ide.codingblocks.com and share its link.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.