- 1
Precompute the Running Total
Spot the range-sum questions where one precomputed table answers every query.
Multiple choiceTap - 2
Running Sum of an Array
Build the prefix table in one pass: each entry is the previous total plus the current number.
Complete codeMultiple choiceTrace - 3
Range Sum in O(1)
Turn every range-sum query into two lookups: P[j + 1] minus P[i].
Complete codeDebugMultiple choiceTap - 4
Find Pivot Index
One running left sum plus the total gives you the right sum for free — no second array, no rescans.
Complete codeMultiple choiceTrace - 5
Product of Array Except Self
Split each answer into a left product and a right product — two sweeps, no division.
Complete codeDebugMultiple choiceTrace - 6
Contiguous Array
Turn 'equal 0s and 1s' into 'same running sum twice' — a hashmap of first-seen sums does the rest.
Complete codeDebugMultiple choiceTrace - 7
Prefix Sum CheckpointCheckpoint
No new concepts — combine the island's rules: build P once with P[0] = 0, answer any range with P[j+1] - P[i], and balance a pivot against one precomputed total.
DebugCode orderFill blankMultiple choiceTapTrace - 8
Prefix Sum ReviewReview
Mixed recap of the island: the running build, O(1) range queries, pivot balance, prefix-times-suffix products, and the prefix + hashmap trick.
Complete codeDebugMultiple choiceTapTrace - 9
Boss: Subarray Sum Equals KBoss
The island's finale: a subarray sums to k exactly when currentPrefix - k has been seen before — so count every prefix in a hashmap seeded with {0: 1}.
Complete codeCode orderMultiple choiceTrace
Array Patterns is part of AlgoFox Pro
You can read the whole course outline here. The exercises are in the app, along with your streak, your mistake review, and the progress that carries across your devices.
Pro starts with a 3 day free trial. The app store decides who is eligible for an introductory offer, and a lapsed subscription does not get another one.
Already subscribed in the app? Sign in with the same account and Pro works here too. Quick Play and Battle are free on the web, and so is the first course in every subject.
