Glossary: Coding Interviews in Rust
Prefix sum
Also written: prefix sums
A running-total list, starting with 0, so any range total is one subtraction: `prefix[end] - prefix[start]`. Setup is O(n) and each question is O(1).
Glossary: Coding Interviews in Rust
Also written: prefix sums
A running-total list, starting with 0, so any range total is one subtraction: `prefix[end] - prefix[start]`. Setup is O(n) and each question is O(1).