Skip to content
Noteshch-log
AboutSupport
< Back to notes

Browse 4 notes tagged prefix sum.

#prefix sum

LeetCode 2574: Left and Right Sum Differences in TypeScript

Compare stored left and right sums with a single scan, including output space, auxiliary space, and the loop invariant.

#LeetCode#TypeScript#algorithms+3
2026-08-26

LeetCode 724: Find a Pivot Index in TypeScript

Find the leftmost pivot index with a total sum and one running left sum, then make the loop invariant and O(n) analysis explicit.

#LeetCode#TypeScript#algorithms+3
2026-08-26

LeetCode 1732: Find the Highest Altitude in TypeScript

Track current altitude and the highest altitude so far in one scan with O(n) time and O(1) auxiliary space.

#LeetCode#TypeScript#algorithms+3
2026-08-25

LeetCode 1480: Running Sum in TypeScript

Use each completed array position as state for one linear scan, with an honest discussion of in-place mutation, the loop invariant, and O(n) time.

#LeetCode#TypeScript#algorithms+3
2026-08-25
Copyright ©2025-2026 hch-log.com. All rights reserved.
Written by Hung-Chih Hsueh ↗ · g3n-data ↗ · All links ↗
Support on Ko-fiAboutPrivacy Policy

Google services settings

Analytics and advertising stay off until you choose.

En中文