Suppose we have 5 pair class and I want to sort in such a way if second is largest then it should come first and is some pairs have same second then those who have first largest should come first so in compare function I wrote
bool compare(pair a, pair b)
return a.second<b.second
If(a.second==b.second)
Return a.first>b.first
This is not giving correct answer