Testcase 1 passed. slight hint would help. I maybe missing some edge case probably.
Thanks 
Testcase 0 failed
Hello @Atul-Sagar-3137455909651980,
Your code is failing for test cases like:
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
Expected Output:
1
2
3
Your Output:
3
3
4
Correct it.
Hope, this would help.
Thanks Virender. I had wrong interpretation of the problem in mind. Test case helped