Module 09 · DSA · Four patterns the ladders lean on
The running total (prefix sums and difference arrays)
Before you start.Foundations #03: Arrays, Do-Pointer & Sliding Window (written in Hinglish) showed the running-total trick once: keep a list of totals so far, put a fake 0 at the front, and any stretch of the array becomes one subtraction. Hashing gave you the hash map: ask for a key and get its value back in one step, no searching. The ladders in The Practice Ladders lean on both. This lesson teaches the trick properly, then bends it three ways.
Lesson 67 of 74 in DSA
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.