What is the compare function doing?And where are the function parameters passed in the function call i.e. compare?

hi @divyanshinegi2003_987b3f0f92dd8c0c lower bound is itself a function it will use tat comparator to comapare the parameters u dont have to mention that, u r changing the behavior of the default lowerbound function usnig comparator
return a<=b in custom compare works like upper_bound(it returns the first value which is not less than or equal to searched value) so lower_bound function with this custom compare will give you value just greater than searched value and subtracting -1 will give you the correct denomination of that money that will be either less than or equals to searched money.

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.