I am not able to make the compare function in sort

https://ide.codingblocks.com/s/233798… I tried this but it not working …plz help asap

@dhirenkinha hey ,I have corrected your code:


Compare only elements in sort function.

sorry sir but it is not working … we were told in the hint to sort it w.r.t. map value

@dhirenkinha hey let me check the question first,I was talking about general case.

@dhirenkinha hey have corrected your code ,see this:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.