← back
Prefix Sum
214 questions · 0 seen
All Prefix Sum problems
Prefix Sum
1
Actions
⊣ Practice
Prefix Sum
⊣ Quiz
Prefix Sum
Problems
⊣ 209 Minimum Size Subarray Sum
Medium
⊣ 238 Product of Array Except Self
Medium
⊣ 303 Range Sum Query - Immutable
Easy
⊣ 304 Range Sum Query 2D - Immutable
Medium
⊣ 363 Max Sum of Rectangle No Larger Than K
Hard
⊣ 410 Split Array Largest Sum
Hard
⊣ 497 Random Point in Non-overlapping Rectangles
Medium
⊣ 523 Continuous Subarray Sum
Medium
⊣ 525 Contiguous Array
Medium
⊣ 528 Random Pick with Weight
Medium
⊣ 560 Subarray Sum Equals K
Medium
⊣ 689 Maximum Sum of 3 Non-Overlapping Subarrays
Hard
⊣ 713 Subarray Product Less Than K
Medium
⊣ 724 Find Pivot Index
Easy
⊣ 731 My Calendar II
Medium
⊣ 732 My Calendar III
Hard
⊣ 798 Smallest Rotation with Highest Score
Hard
⊣ 813 Largest Sum of Averages
Medium
⊣ 848 Shifting Letters
Medium
⊣ 862 Shortest Subarray with Sum at Least K
Hard
⊣ 903 Valid Permutations for DI Sequence
Hard
⊣ 930 Binary Subarrays With Sum
Medium
⊣ 974 Subarray Sums Divisible by K
Medium
⊣ 995 Minimum Number of K Consecutive Bit Flips
Hard
⊣ 1000 Minimum Cost to Merge Stones
Hard
⊣ 1004 Max Consecutive Ones III
Medium
⊣ 1074 Number of Submatrices That Sum to Target
Hard
⊣ 1094 Car Pooling
Medium
⊣ 1109 Corporate Flight Bookings
Medium
⊣ 1124 Longest Well-Performing Interval
Medium
⊣ 1140 Stone Game II
Medium
⊣ 1177 Can Make Palindrome from Substring
Medium
⊣ 1208 Get Equal Substrings Within Budget
Medium
⊣ 1248 Count Number of Nice Subarrays
Medium
⊣ 1292 Maximum Side Length of a Square with Sum Less than or Equal to Threshold
Medium
⊣ 1310 XOR Queries of a Subarray
Medium
⊣ 1314 Matrix Block Sum
Medium
⊣ 1352 Product of the Last K Numbers
Medium
⊣ 1371 Find the Longest Substring Containing Vowels in Even Counts
Medium
⊣ 1413 Minimum Value to Get Positive Step by Step Sum
Easy
⊣ 1420 Build Array Where You Can Find The Maximum Exactly K Comparisons
Hard
⊣ 1422 Maximum Score After Splitting a String
Easy
⊣ 1423 Maximum Points You Can Obtain from Cards
Medium
⊣ 1442 Count Triplets That Can Form Two Arrays of Equal XOR
Medium
⊣ 1444 Number of Ways of Cutting a Pizza
Hard
⊣ 1480 Running Sum of 1d Array
Easy
⊣ 1508 Range Sum of Sorted Subarray Sums
Medium
⊣ 1524 Number of Sub-arrays With Odd Sum
Medium
⊣ 1546 Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
Medium
⊣ 1588 Sum of All Odd Length Subarrays
Easy
⊣ 1589 Maximum Sum Obtained of Any Permutation
Medium
⊣ 1590 Make Sum Divisible by P (PRO)
Medium
⊣ 1621 Number of Sets of K Non-Overlapping Line Segments
Medium
⊣ 1658 Minimum Operations to Reduce X to Zero
Medium
⊣ 1664 Ways to Make a Fair Array
Medium
⊣ 1674 Minimum Moves to Make Array Complementary
Medium
⊣ 1685 Sum of Absolute Differences in a Sorted Array
Medium
⊣ 1687 Delivering Boxes from Storage to Ports
Hard
⊣ 1703 Minimum Adjacent Swaps for K Consecutive Ones
Hard
⊣ 1712 Ways to Split Array Into Three Subarrays
Medium
⊣ 1732 Find the Highest Altitude
Easy
⊣ 1737 Change Minimum Characters to Satisfy One of Three Conditions
Medium
⊣ 1738 Find Kth Largest XOR Coordinate Value (PRO)
Medium
⊣ 1744 Can You Eat Your Favorite Candy on Your Favorite Day?
Medium
⊣ 1769 Minimum Number of Operations to Move All Balls to Each Box
Medium
⊣ 1829 Maximum XOR for Each Query
Medium
⊣ 1838 Frequency of the Most Frequent Element
Medium
⊣ 1854 Maximum Population Year (PRO)
Easy
⊣ 1856 Maximum Subarray Min-Product
Medium
⊣ 1862 Sum of Floored Pairs
Hard
⊣ 1871 Jump Game VII
Medium
⊣ 1872 Stone Game VIII
Hard
⊣ 1878 Get Biggest Three Rhombus Sums in a Grid
Medium
⊣ 1889 Minimum Space Wasted From Packaging
Hard
⊣ 1893 Check if All the Integers in a Range Are Covered
Easy
⊣ 1894 Find the Student that Will Replace the Chalk
Medium
⊣ 1895 Largest Magic Square (PRO)
Medium
⊣ 1906 Minimum Absolute Difference Queries (PRO)
Medium
⊣ 1915 Number of Wonderful Substrings
Medium
⊣ 1930 Unique Length-3 Palindromic Subsequences (PRO)
Medium
⊣ 1943 Describe the Painting
Medium
⊣ 1959 Minimum Total Space Wasted With K Resizing Operations
Medium
⊣ 1991 Find the Middle Index in Array (PRO)
Easy
⊣ 2017 Grid Game
Medium
⊣ 2024 Maximize the Confusion of an Exam
Medium
⊣ 2025 Maximum Number of Ways to Partition an Array
Hard
⊣ 2055 Plates Between Candles
Medium
⊣ 2100 Find Good Days to Rob the Bank
Medium
⊣ 2106 Maximum Fruits Harvested After at Most K Steps
Hard
⊣ 2121 Intervals Between Identical Elements
Medium
⊣ 2132 Stamping the Grid
Hard
⊣ 2145 Count the Hidden Sequences
Medium
⊣ 2171 Removing Minimum Number of Magic Beans
Medium
⊣ 2207 Maximize Number of Subsequences in a String
Medium
⊣ 2209 Minimum White Tiles After Covering With Carpets
Hard
⊣ 2218 Maximum Value of K Coins From Piles
Hard
⊣ 2222 Number of Ways to Select Buildings
Medium
⊣ 2234 Maximum Total Beauty of the Gardens
Hard
⊣ 2245 Maximum Trailing Zeros in a Cornered Path
Medium
⊣ 2251 Number of Flowers in Full Bloom
Hard
⊣ 2256 Minimum Average Difference
Medium
⊣ 2270 Number of Ways to Split Array
Medium
⊣ 2271 Maximum White Tiles Covered by a Carpet
Medium
⊣ 2281 Sum of Total Strength of Wizards
Hard
⊣ 2302 Count Subarrays With Score Less Than K
Hard
⊣ 2381 Shifting Letters II
Medium
⊣ 2382 Maximum Segment Sum After Removals
Hard
⊣ 2389 Longest Subsequence With Limited Sum
Easy
⊣ 2391 Minimum Amount of Time to Collect Garbage
Medium
⊣ 2398 Maximum Number of Robots Within Budget
Hard
⊣ 2406 Divide Intervals Into Minimum Number of Groups
Medium
⊣ 2420 Find All Good Indices
Medium
⊣ 2428 Maximum Sum of an Hourglass
Medium
⊣ 2438 Range Product Queries of Powers
Medium
⊣ 2439 Minimize Maximum of Array
Medium
⊣ 2448 Minimum Cost to Make Array Equal
Hard
⊣ 2478 Number of Beautiful Partitions
Hard
⊣ 2483 Minimum Penalty for a Shop
Medium
⊣ 2485 Find the Pivot Integer
Easy
⊣ 2488 Count Subarrays With Median K
Hard
⊣ 2528 Maximize the Minimum Powered City
Hard
⊣ 2536 Increment Submatrices by One
Medium
⊣ 2552 Count Increasing Quadruplets
Hard
⊣ 2559 Count Vowel Strings in Ranges
Medium
⊣ 2574 Left and Right Sum Differences
Easy
⊣ 2587 Rearrange Array to Maximize Prefix Score
Medium
⊣ 2588 Count the Number of Beautiful Subarrays
Medium
⊣ 2602 Minimum Operations to Make All Array Elements Equal
Medium
⊣ 2615 Sum of Distances
Medium
⊣ 2640 Find the Score of All Prefixes of an Array
Medium
⊣ 2680 Maximum OR
Medium
⊣ 2681 Power of Heroes
Hard
⊣ 2731 Movement of Robots
Medium
⊣ 2772 Apply Operations to Make All Array Elements Equal to Zero
Medium
⊣ 2845 Count of Interesting Subarrays
Medium
⊣ 2848 Points That Intersect With Cars
Easy
⊣ 2875 Minimum Size Subarray in Infinite Array
Medium
⊣ 2906 Construct Product Matrix
Medium
⊣ 2947 Count Beautiful Substrings I
Medium
⊣ 2949 Count Beautiful Substrings II
Hard
⊣ 2968 Apply Operations to Maximize Frequency Score
Hard
⊣ 2971 Find Polygon With the Largest Perimeter
Medium
⊣ 2983 Palindrome Rearrangement Queries
Hard
⊣ 3015 Count the Number of Houses at a Certain Distance I
Medium
⊣ 3017 Count the Number of Houses at a Certain Distance II
Hard
⊣ 3026 Maximum Good Subarray Sum
Medium
⊣ 3028 Ant on the Boundary
Easy
⊣ 3070 Count Submatrices with Top-Left Element and Sum Less Than k
Medium
⊣ 3077 Maximum Strength of K Disjoint Subarrays
Hard
⊣ 3086 Minimum Moves to Pick K Ones (PRO)
Hard
⊣ 3096 Minimum Levels to Gain More Points
Medium
⊣ 3129 Find All Possible Stable Binary Arrays I
Medium
⊣ 3130 Find All Possible Stable Binary Arrays II
Hard
⊣ 3147 Taking Maximum Energy From the Mystic Dungeon
Medium
⊣ 3152 Special Array II
Medium
⊣ 3179 Find the N-th Value After K Seconds
Medium
⊣ 3191 Minimum Operations to Make Binary Array Elements Equal to One I
Medium
⊣ 3212 Count Submatrices With Equal Frequency of X and Y
Medium
⊣ 3224 Minimum Array Changes to Make Differences Equal
Medium
⊣ 3225 Maximum Score From Grid Operations
Hard
⊣ 3250 Find the Count of Monotonic Pairs I
Hard
⊣ 3251 Find the Count of Monotonic Pairs II
Hard
⊣ 3261 Count Substrings That Satisfy K-Constraint II
Hard
⊣ 3312 Sorted GCD Pair Queries (PRO)
Hard
⊣ 3333 Find the Original Typed String II
Hard
⊣ 3346 Maximum Frequency of an Element After Performing Operations I
Medium
⊣ 3347 Maximum Frequency of an Element After Performing Operations II
Hard
⊣ 3354 Make Array Elements Equal to Zero
Easy
⊣ 3355 Zero Array Transformation I
Medium
⊣ 3356 Zero Array Transformation II
Medium
⊣ 3361 Shift Distance Between Two Strings
Medium
⊣ 3362 Zero Array Transformation III
Medium
⊣ 3364 Minimum Positive Sum Subarray
Easy
⊣ 3381 Maximum Subarray Sum With Length Divisible by K
Medium
⊣ 3413 Maximum Coins From K Consecutive Bags
Medium
⊣ 3425 Longest Special Path
Hard
⊣ 3427 Sum of Variable Length Subarrays
Easy
⊣ 3432 Count Partitions with Even Sum Difference
Easy
⊣ 3434 Maximum Frequency After Subarray Operation
Medium
⊣ 3445 Maximum Difference Between Even and Odd Frequency II
Hard
⊣ 3473 Sum of K Subarrays With Length at Least M
Medium
⊣ 3480 Maximize Subarrays After Removing One Conflicting Pair
Hard
⊣ 3486 Longest Special Path II
Hard
⊣ 3494 Find the Minimum Amount of Time to Brew Potions
Medium
⊣ 3500 Minimum Cost to Divide Array Into Subarrays
Hard
⊣ 3538 Merge Operations for Minimum Travel Time
Hard
⊣ 3546 Equal Sum Grid Partition I
Medium
⊣ 3548 Equal Sum Grid Partition II
Hard
⊣ 3578 Count Partitions With Max-Min Difference at Most K
Medium
⊣ 3599 Partition Array to Minimize XOR
Medium
⊣ 3628 Maximum Number of Subsequences After One Inserting
Medium
⊣ 3636 Threshold Majority Queries
Hard
⊣ 3652 Best Time to Buy and Sell Stock using Strategy
Medium
⊣ 3654 Minimum Sum After Divisible Sum Deletions
Medium
⊣ 3694 Distinct Points Reachable After Substring Removal
Medium
⊣ 3698 Split Array With Minimum Difference
Medium
⊣ 3699 Number of ZigZag Arrays I
Hard
⊣ 3707 Equal Score Substrings
Easy
⊣ 3709 Design Exam Scores Tracker
Medium
⊣ 3714 Longest Balanced Substring II
Medium
⊣ 3719 Longest Balanced Subarray I
Medium
⊣ 3721 Longest Balanced Subarray II
Hard
⊣ 3728 Stable Subarrays With Equal Boundary and Interior Sum
Medium
⊣ 3729 Count Distinct Subarrays Divisible by K in Sorted Array
Hard
⊣ 3737 Count Subarrays With Majority Element I
Medium
⊣ 3739 Count Subarrays With Majority Element II
Hard
⊣ 3748 Count Stable Subarrays
Hard
⊣ 3755 Find Maximum Balanced XOR Subarray Length
Medium
⊣ 3756 Concatenate Non-Zero Digits and Multiply by Sum II
Medium
⊣ 3771 Total Score of Dungeon Runs
Medium
⊣ 3788 Maximum Score of a Split
Medium
⊣ 3797 Count Routes to Climb a Rectangular Grid
Hard
⊣ 3826 Minimum Partition Score
Hard
⊣ 3845 Maximum Subarray XOR with Bounded Range
Hard