Activity selection problems (why my code is not passing testcases)

@Saksham12
hello saksham,
for input .
3
3
3 9
2 8
6 9
4
1 7
5 8
7 8
1 8
6
7 9
0 10
4 5
8 9
4 10
5 7

ur code output is
1
2
1
but actually it should be
1
2
3