Activity selection problem


where im wrong in this code

Hello @mohitsharmakosi2001 in this question you should take one vector of pair and sort that using comparator on the basis of their ending time.
in this we have to check that if the start time of the previous ongoing meeting’s ending time.

ther could be possibility that the meeting must be there which is going on and that may not be the next one so for that in comparing condition we will take variable to and in that store the meeting number to compare with the next meetings time.
it is not necessary that only the two continuous meetings can overlap.

we can’t do it without vector and pair

you would not be able to pass all the test cases as you have to check for all the cases and that will only be possible if you are doing sortineg acc. to their ending time.

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.