I have written my doubt in the code itself

hello @laksh.rustagi12

dont pass compare funtion in the lower bound. that compare function will make it act as upper bound.

rather I should use upper_bound and subtract 1 from index.
I don’t know why prateek bhaiya has gone the long way

yeah u can ,he just want to show that we can change the functionality of these functions as per our need.

1 Like