Indian Currency Problem

Why sir still doing -1 at line 15 when we used our compare function. Can u clear it more?.

@cyberaj123 If u observe that
if u just write
lower_bound(arr,arr+n,key,compare)
without -1 then giving a money value which exists in the array
will return a wrong value
it returns the next greater value in the array

hence the -1 is required so that even 120 and 100 would give us answer 100
in case -1 is not written then 100 would give answer 200 because of the comparator