Here's a problem you'll see constantly: given an array, answer many queries asking for the sum of elements from index to .
The naive approach loops from to and adds up elements. Each query takes time. With queries, that's total.
If and , you're doing billion operations. That's too slow. There's a better way.