Pattern
Prefix Sum
A compact view of archive entries grouped by recurring technique.
20 entries
20 entries tagged as Prefix Sum.
24.03.2026
medium2906. Construct Product Matrix
Product of other cells in a matrix
18.03.2026
medium3070. Count Submatrices with Top-Left Element and Sum Less Than k
Count prefix sums less than K
07.03.2026
medium1888. Minimum Number of Flips to Make the Binary String Alternating
Min flips to make 01 alterating string sum window
11.02.2026
hard3721. Longest Balanced Subarray II
Max subarray evens count = odds count tree
19.01.2025
medium1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
Max square with sum less than threshold
23.12.2025
medium2054. Two Best Non-Overlapping Events
Max at most two non-overlapping events max
09.12.2025
medium3583. Count Special Triplets
Count a[i]==a[j] 2==a[k] sum
06.12.2025
medium3578. Count Partitions With Max-Min Difference at Most K
Ways to partition into parts (max-min) at most k queue
17.10.2025
medium3003. Maximize the Number of Partitions After Operations
Max k-uniq parts after changing one letter
11.06.2025
hard3445. Maximum Difference Between Even and Odd Frequency II
Max odd - min even frequency, window at least k
20.05.2025
medium3355. Zero Array Transformation I
Can intersecting intervals decrease an array sweep
26.02.2025
medium1749. Maximum Absolute Sum of Any Subarray
Max abs of subarray sum sum
25.02.2025
medium1524. Number of Sub-arrays With Odd Sum
Count odd sum subarrays sum
14.02.2025
medium1352. Product of the Last K Numbers
Running suffix product product
21.01.2025
medium2017. Grid Game
Maximum of minimized paths sum
06.01.2025
medium1769. Minimum Number of Operations to Move All Balls to Each Box
Sum distances to all 1 for every position sum
03.01.2025
medium2270. Number of Ways to Split Array
Count splits left sum >= right sum sum
02.01.2025
medium2559. Count Vowel Strings in Ranges
Count words[q[0]..q[1]] starting and ending with "aeiou"
03.10.2024
medium1590. Make Sum Divisible by P
Min removed subarray length to make remainder % p = 0
31.03.2023
hard1444. Number of Ways of Cutting a Pizza
carefully precompute prefix sum. You move by row, increasing sumX, then you move by column and reuse the result of the previous row.