add flashcard generation tooling and binary search cards

- 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
This commit is contained in:
2026-06-08 01:28:25 +08:00
parent c67841fe07
commit e10cc4257d
9 changed files with 2052 additions and 9 deletions
@@ -0,0 +1,11 @@
#+ANKI_DECK: study_deck_02
* When to use lower_bound vs binary_search :cpp:binary-search:algorithm:retrieval::recognition:
:PROPERTIES:
:END:
** Front
When should you use ~std::lower_bound~ instead of ~std::binary_search~?
** Back
Use ~lower_bound~ when you need the *position/index* of the element.
Use ~binary_search~ when you only need to know *if it exists* (bool).