Money change Problem

In the video, bhaiya has used a comparator. I want to ask that how comparator is working by providing condition a<=b

@ashwani225 hey without comparator lower bound searching key se bda index aya uske equal element ka index return krta tha,but using our comparatot we use <= iska mtlb ki ab woh searching key ke equal element ka index return krega agr mila to else usse chote ka index return krega ,hope you get it.

Bro I didn’t get it. can you explain by giving any example ??

Look while sorting we are using comparator to reverse the array but in sorting if we provide a<b comparator then it sort in Ascecding order.So only chaging it by <= what changes will occur and lower_bound only give value >= key then how it can be reversed ??

@ashwani225 hi bro ,ye comparator does not provide logic for work ye sirf greater or lesser ke sign ke acc compare krne ke kam ata hai ,ab hme <= lgaya hai mtlb lower bound is condition se compare krega elements ko using this condition.

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.