Prefix Sum
- 2023.08.29
- Algorithm Prefix Sum
Definition
Prefix Sum
The sums of prefixes (running totals).
$$ y_i = \sum^i_{k = 0}{x_k} $$
前 i 個 xk 的總和
Prefix
ex:
breakfast
bre 是 breakfast 的 prefix
相關例題
- Leetcode # 523. Continuous Subarray Sum
- Leetcode # 769. ⭐ Max Chunks To Make Sorted
- Leetcode # 974. ⭐️ Subarray Sums Divisible by K
- Leetcode # 2483. Minimum Penalty for a Shop
- Leetcode # 2845. Count of Interesting Subarrays
- Leetcode # 2873. Maximum Value of an Ordered Triplet I
- Leetcode # 2874. ⭐️ Maximum Value of an Ordered Triplet II
不用確實計算 Prefix Sum 的例子
Ref
Last Updated on 2024/06/08 by A1go