What does the upper bound function do, please explain. Also the code in the video is not clear as it makes use of upper bound function.
Min Coins Change
hello @Sakshi2004
upper_bound() is a standard library function in C++ defined in the header . It returns an iterator pointing to the first element in the range [first, last) that is greater than value, or last if no such element is found.
example->
10 20 30 30 40 50
upper_bound for element 30 is at index 4 (i,e 40)
now rewatch the video again