Activity selection problem

given test case pass but one test case giving wrong answer

Hi @dhairya16
dis is a standard greedy problem. In dis, u first need to sort the vector u have taken input acc. to end time and then find maximum number of activity u can select. Sorting is very important otherwise u wont get desired output.
eg. vector={(3,5),(1,2)}, ur code will give output=1 whereas answer is 2 which we get after sorting the array first.
Hope dis resolves ur doubt.