Testcases not passing

my sample test case is passing but my testcases are not.
What’s the problem with my code.


I used sorting and stored (end,start) pair and applied the greedy logic.
reply as soon as possible.

u need to have custom sort function

and also the way u include this way

Custom sort function doesn’t matter as i have stored end as first argument in pair
Then whats the problem in my code.

okay i did not notice that please wait let me check

for test case:
4
2 3
4 1
4 2
6 4

ur answer
1

required
3

try doing it the normal way
pair meh c-r , c+r he push karke dekho
then ekh baar use answer aye then try this twisted version m

logic thoda glt lag rha h

I made the custom compare function as u told me but still it is not working . Modified code : https://ide.codingblocks.com/s/292077

image

Now 2 testcase are not passing out of 6 . CODE : https://ide.codingblocks.com/s/292077

iss code meh comparator dekho