Skip to content

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).

Where the book teaches it

Related terms

Sliding window