Fetching algorithms...
Fetching algorithms...
Watch key transitions, pointers, and variables update step-by-step.
Read clean, documented implementations across multiple patterns.
Sketch diagrams on an infinite canvas and draft notes directly inline.
nums = [3, 2, -1, 6, 5, 4, -3, 3, 7, 2, 3]Prefix Sum up to index 5: 19 (3 + 2 + (-1) + 6 + 5 + 4 = 19), After updating nums[2] to 5: New Prefix Sum up to index 5: 25 (3 + 2 + 5 + 6 + 5 + 4 = 25)nums = [1, 2, 3, 4, 5]Prefix Sum up to index 3: 10 (1+2+3+4), After updating nums[1] to 5: New Prefix Sum up to index 3: 13 (1+5+3+4)Time Complexity
Space Complexity