Check out example codes for "find in set of pairs using first value cpp". It will help you in understanding the concepts better.

Code Example 1

auto it = std::find_if(st.begin(), st.end(), [](const pair<int,int>& p ){ return p.first == 1; });

Learn ReactJs, React Native from akashmittal.com