Money change problem

i got the compartor function,it will give us lower bound of 168 that is 100 ,but why pratik bhaiya wrtieen -1 at last.

Hey @firozbhaikardar21 because using this comparator you always get index+1 as returned value even when you find the exact match. Try to write this code and see how it runs for values that are both present and not present in the array.

If you don’t have any further queries please mark the doubt as resolved.

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.