Compare function

i am not able to understand how the bool function is working ,how is it returning true value i dont get it ,please explain working of bool function with regards to the compare function used here

@chitranshanmol07 hey its stl think of it as syntax and here is a little explanation.
in sort function if you pass compare or any name in an argument then you have to make bool of that argument which accepts 2 parameters (meaning adjacent pairs going in sorting which is made internal by developers) . so a<b return means sort in descending else ascending.
i hope its clear if yes dont forget to mark it as resolved :smiley:

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.