Check each structure's retained state, operation boundary, and failure rule against its runnable trace. Several answers depend on an interval endpoint or a count tie.
Lessons
- Persistent subarray ranks: subtract prefix frequency trees
- Maximum-subarray segment trees: preserve the crossing burst
- Li Chao interval offers: limit each line to its valid minutes
- All-one frequency buckets: increment, decrement, and read both extremes
- Patricia binary routing: compress chains without losing prefix matches
