Tonight's goal: pick your 3 weakest advanced-tree problems, re-solve each from a blank file with no hints, and prove the invariant still comes back under pressure.
Tonight's protocol
Use the revision-day protocol: recall first, code second, only the first or second run counts.
0:00–0:05 Warm up: answer the MCQs below without notes. Mark any invariant you miss.
0:05–0:08 Choose: pick your 3 weakest from the menu. Weakest means missed invariant, slowest recall, or least confidence.
For each chosen problem, 25 minutes: spend 2 minutes saying the pattern name, invariant, brute force, and target complexity; spend 18 minutes coding in a blank file; spend 5 minutes running and making one fix.
After each problem, 2 minutes: mark Pass only if it compiles and passes on run one or two. Otherwise write WA: <root cause>.
Final 7 minutes: compare only failed or unclear items with the source lesson, then encode one correction sentence in your tracker.
The problem menu
Redo your 3 weakest. Blank file, no hints, no stored code.
1. Which invariant decides the LCA when targets split?
Source invariant: "If the two targets are found in different subtrees of a node, you are standing on the answer."
2. What keeps Right Side View level boundaries honest?
Source invariant: "A queue processes nodes in the order discovered; snapshot the queue length to process exactly one level at a time." Right Side View then keeps the last node from each level.
3. What makes serialized tree shape unambiguous?
Source invariant: "Preorder with explicit null markers is unambiguous — the string rebuilds exactly one tree."
4. When may Path Sum accept a path?
Source invariant: "Subtract the node's value as you descend; a path exists iff some leaf sees exactly zero remaining."
5. Which fact starts each reconstruction step?
Source invariant: "The first preorder value is the root, and its position in inorder splits everything into left and right subtrees — recurse with a hashmap for O(1) splits."
Self-check gate
Gate
Tonight's bar
Pass
All 3 selected problems pass from a blank file on run one or two, and you state the matching invariant before coding.
Fail
Any selected problem needs hints, stored code, notes during the timer, or a third run before passing.
If a problem fails the gate, add that exact problem to the next revision queue. Write one cause: missed split, blurred level boundary, forgotten null marker, early Path Sum success, or wrong traversal range.