e10cc4257d
- gen-flashcards.py: auto-generate recognition cards from all problem files - toolkit/gen-problem-cards.org: 199 auto-generated problem cards - 5 binary search tool cards (std::binary_search, std::lower_bound, comparison, two-sum pattern, sorting gotcha) - two-sum.org: add binary search C++ attempt - lc-org.el: add doom emacs localleader keybinding support
384 B
384 B
std::lower_bound: find position of element :cpp:binary-search:algorithm:retrieval::recognition:
Front
What does std::lower_bound return?
Back
An iterator to the first element >= the given value. Returns end() if no such element exists.
auto it = std::lower_bound(vec.begin(), vec.end(), value);