I wanted to ask that in the video bhaiya has used the statement:
int lb=lower_bound(coins,coins+n,key,compare)-coins-1;
so the above will return the index for 50 but it should be for the 100 pls clarify ; money=168
I wanted to ask that in the video bhaiya has used the statement:
int lb=lower_bound(coins,coins+n,key,compare)-coins-1;
so the above will return the index for 50 but it should be for the 100 pls clarify ; money=168
@jsn853
observe carefully you will get 100 for 168 here cause your lowerbound function will return 200 as answer then subtracting 1 from this will give you index of 100.
ok bhaiya interepreted it wrong thanks
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.