Hello, Keys
Variables, loops, functions and conditionals
Variables and expressions / Conditionals / Loop accumulators / State in a loop / Helper functions
New to coding? The optional Foundation lessons can help.
Nine chapters. One very curious typist.
Start small, find the patterns, and follow the ink.
Variables, loops, functions and conditionals
Variables and expressions / Conditionals / Loop accumulators / State in a loop / Helper functions
Arrays and strings
Adjacent array positions / String runs / Stable array filtering / Nested array traversal / String scanning
Maps, sets, counting and sorting
Frequency maps / Set membership / Set intersection / Map grouping / Comparator sorting
Two pointers, windows and prefix sums
Opposite-end pointers / Read and write pointers / Fixed sliding windows / Variable sliding windows / Prefix range subtraction / Two sorted streams
Stacks, queues, deques and simulations
Stack cancellation / Monotonic stacks / Queue simulation / Monotonic deques / Stack history
Recursion, sorting, binary search and bits
Divide-and-conquer recursion / Merge sort / Binary search boundaries / Binary search on answers / Bit counting / Prefix bit state
Linked lists, binary trees and search trees
Linked traversal / Linked pointer reversal / Fast and slow pointers / Tree preorder / Tree breadth-first traversal / BST range pruning
Graphs, heaps, union-find and tries
Graph breadth-first distances / Topological queues / Priority-queue shortest paths / Binary heaps / Union-find components / Trie prefix counts / Graph depth-first components
Greedy choices, dynamic programming and backtracking
Greedy interval selection / Counting dynamic programming / Unbounded dynamic programming / Zero-one knapsack / Sequence DP with binary search / Interval dynamic programming / Backtracking choices / Backtracking with occupancy / Scheduling DP and binary search