didn’t understand the use of compare function what actually it is performing?
Money change coin using lower bound
@sunnydhankhar12 The lower_bound() method in C++ is used to return an iterator pointing to the first element in the range [first, last) which has a value not less than val. This means that the function returns the index of the next smallest number just greater than that number. But this is not what we need, we need the index of the greatest number which is smaller than the provided value. So this is why compare function returns a <= b ie numbers which are less than or equal to our given value.
why cant we use upperbound function and decrease the index