i am not able to understand lower bound function used in this problem
Please explain lower bound function usage in this problem
@bhavyac888_4c41066a0fcdb581 read about lower bound function you’ll get it ( or first watch the lecture on lower bounds)
The lower_bound() method in C++ is used to return an iterator pointing to the first element in the range [first, last) which has a value not less than val. This means that the function returns the index of the next smallest number just greater than or equal to that number. If there are multiple values that are equal to val, lower_bound() returns the index of the first such value.
The elements in the range shall already be sorted or at least partitioned with respect to val.
here we needed for 25 so it returned 50 but we cannot take 50 so reduced 1 after recuding the base address