I cant solve the problem please tell me the logic

I cant solve the problem activity selection problem please help

Hello @anmolaggarwal.432 check this:
in this question we will decide this with the help of the ending time of the meeting:
for this test case:
1
3
10 20
12 15
20 30
like suppose: if there are 3 element meetings in total then the person can attend the meetings which will end before the starting time of the other meeting so for that we will sort the meetin on the basis of their ending time and then we will make our comparison.
like in this the person is in the 0th meeting and then we can see that before the ending of the current meeting the other meeting is started and that’s why we have to skip the second meeting and check for the 2nd meeting.
in this way he is ale to attend only 2 meetings.

He can also attend 12 15 and 20 meeting??

so we have to optimize the sort function acording to this end time schedule right???

Could you explain it to me in the code?? please reply

@anmolaggarwal.432 yes right.

@anmolaggarwal.432 here is the code for that problem:

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.