What does the upper_bound function do? Cant we just use the fact that our coin array is sorted.
Upper_bound function
@drjindalsubhash
upper_bound function is an implementation of binary search which returns upper_bound of the searched element in the array. Since it is binary search it is already using the fact that the coin array is sorted.
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.