Why did we return d1<d2 in the function?

In the bool compare function we return p1.first< p2.first and then d1 < d2.
How does doing that return the smaller number?
Please explain the logic behind it. Like what happens if d1>d2?

Hey @Tung_H see this For better understanding
Still have a doubt can ask me :slight_smile:

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.