Can you tell me what’s wrong with my code.
It giving the right answers for the sample test case but it is not being accepted
Max number of activities(STL)
are u getting tle?
dont use this ( as this is take too much time) ,

instead use sort function.
ur updated code->
Sir,in the updated code you have sorted the list with respect to the the second element in the pair.Can you please tell me where will it fail if I sort it with respect to the first element?
consider these activities->
1 10
2 3
3 4
4 5
5 6
and run ur algorithm
I got it Sir.Thank you for your help.