my doubt in this question is we use comparator function as a parameter in lower bound function to get the lower bound according to our problem i.e is for 168 we want 100 as lower bound.
for that we make compare function in which we pass two integer one is current money we have and the other according to me is the corresponding lower bound i.e
for 168 lower bound 100 compare it
then 68 lower bound 50 50<68 return true and so on
i am confusing in the second integer of the comparator function one is current money what about the other one tell me
Money change problem using comparator
@dipeshgupta197 see the output of this code
you can see that one argument is the “money” variable, the variable for which we want to find the lower bound
and the other argument is values from the array that we are searching
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.