Patterns
If you're getting started, the win is recognizing the pattern—the family a problem belongs to—and knowing what to do next on the board. Karkai is built around that, not around grinding a huge problem count.
Each card below describes what the pattern is for. Where a track is live, use Open in workspace for guided, hands-on practice on the live board with reviews in the same place.
Move indices on arrays or sequences to shrink a search space—common on sorted data, merging streams, and palindrome-style walks.
Maintain a window over an array or string—fixed or variable size—with O(1) updates as it slides.
Halve the search space on sorted structure—or on an implicit “answer space” when the predicate is monotone.
Systematic traversal for trees, grids, and graphs—levels vs depth, stacks vs queues, visited sets.
Overlapping subproblems and optimal substructure—tables, memoization, and classic recurrence families.
Local choices that stay safe under an exchange argument—often after sorting or a clear ordering.
Build candidates incrementally, prune when constraints fail—permutations, subsets, boards, and words.
Priority queues for running medians, scheduling, and k-way merges—log-time inserts and extracts.
Traversals, parent pointers, balanced structures, and classic tree interview idioms.
Shortest paths, ordering, components, and weighted edges—adjacency models you can reason about fast.
Track connected components with near-constant merges and finds—great for dynamic connectivity.
Masks, XOR tricks, and low-level patterns for subsets, parity, and compact state.