Activity Select Code

Can u please tell me what is logically incorrect in my code, I’ve tested my own testcases which are giving answers as per the logic asked in the code still all the testcases are failing.

My code is at “https://ide.codingblocks.com/s/673196”.

hi @kartikey.rajput0071
1
3
10 20
12 15
20 30
answer is 2