Fenwick Trees and Segment Trees: When Updates and Queries Interleave
Prefix sums break the moment an element changes. Two structures answer range questions and point updates in logarithmic time, and one of them is twenty lines.
Problem Solving From Zero19