Money exchange problem

can you explain how the comparator is working in this problem

Hi @sushreesamapika41 , when we pass on comparator in argument then the comparison made in lower_bound code is made through our custom comparator function

comparator accepts two arguments and returns a value convertible to bool. The value returned indicates whether the first argument is considered to go before the second.

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.