Issue in output of lower_bound custom comparator

considering default comparator function for lower_bound is:

bool compare(int a, int b){
return a>=b
}

using this lower_bound function checks if it gets any element >= key it breaks and return that index.
now our custom comparator function is:

bool compare(int a, int b){
return a<=b
}

then lower_bound using this comparator should return first element as it is <= key we provided.

Why we did lower_bound()-coins-1 Go through this discussion. This may clear your doubt how the custom comparator is working

Thanks a lot for the quick resolution