I have a use case wherein numbers are monotonically increasing in an vector of integers
vec[0] = 2
vec[1] = 5
vec[2] = 8
vec[3] = 10
..
If I am passed number 6, I want to return vec[1], since it lies between vec[1] and vec[2], similarly if passes 9 would have to return vec[2]. My experience with STL is limited , so wanted to check can we solve this with STL or you have to iterate over each by storing the previous and when hit a number greater than the passed number you return