Output and explanation

vector< int > data = { 1, 1, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6 };
auto lower = std::lower_bound(data.begin(), data.end(), 4);
auto upper = std::upper_bound(data.begin(), data.end(), 4);
for(auto it = lower; it != upper; it++)
cout << *it << ’ ';

it is obvious that output should be
4 4 4

you can read about lower bound and upperbound here
https://en.cppreference.com/w/cpp/algorithm/lower_bound
http://www.cplusplus.com/reference/algorithm/upper_bound/

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.