Tag: prefix-sum
- Ant on the Boundary
- Apply Operations to Make All Array Elements Equal to Zero
- Apply Operations to Maximize Frequency Score
- Binary Subarrays With Sum
- Brightest Position on Street
- Build Array Where You Can Find The Maximum Exactly K Comparisons
- Can Make Palindrome from Substring
- Can You Eat Your Favorite Candy on Your Favorite Day?
- Car Pooling
- Change Minimum Characters to Satisfy One of Three Conditions
- Check if All the Integers in a Range Are Covered
- Construct Product Matrix
- Contiguous Array
- Continuous Subarray Sum
- Corporate Flight Bookings
- Count Beautiful Substrings I
- Count Beautiful Substrings II
- Count Increasing Quadruplets
- Count Number of Nice Subarrays
- Count of Interesting Subarrays
- Count Partitions with Even Sum Difference
- Count Positions on Street With Required Brightness
- Count Subarrays With Median K
- Count Subarrays With Score Less Than K
- Count Submatrices With Equal Frequency of X and Y
- Count Submatrices with Top-Left Element and Sum Less Than k
- Count Substrings That Satisfy K-Constraint II
- Count the Hidden Sequences
- Count the Number of Beautiful Subarrays
- Count the Number of Houses at a Certain Distance I
- Count the Number of Houses at a Certain Distance II
- Count Triplets That Can Form Two Arrays of Equal XOR
- Count Vowel Strings in Ranges
- Delivering Boxes from Storage to Ports
- Describe the Painting
- Divide Intervals Into Minimum Number of Groups
- Find All Good Indices
- Find All Possible Stable Binary Arrays I
- Find All Possible Stable Binary Arrays II
- Find Good Days to Rob the Bank
- Find Kth Largest XOR Coordinate Value
- Find Longest Self-Contained Substring
- Find Pivot Index
- Find Polygon With the Largest Perimeter
- Find the Count of Monotonic Pairs I
- Find the Count of Monotonic Pairs II
- Find the Highest Altitude
- Find the Longest Substring Containing Vowels in Even Counts
- Find the Middle Index in Array
- Find the Minimum Amount of Time to Brew Potions
- Find the N-th Value After K Seconds
- Find the Original Typed String II
- Find the Pivot Integer
- Find the Score of All Prefixes of an Array
- Find the Student that Will Replace the Chalk
- Frequency of the Most Frequent Element
- Get Biggest Three Rhombus Sums in a Grid
- Get Equal Substrings Within Budget
- Grid Game
- Increment Submatrices by One
- Intervals Between Identical Elements
- Jump Game VII
- Largest Magic Square
- Largest Sum of Averages
- Left and Right Sum Differences
- Longest Special Path II
- Longest Special Path
- Longest Subsequence With Limited Sum
- Longest Well-Performing Interval
- Make Array Elements Equal to Zero
- Make Sum Divisible by P
- Matrix Block Sum
- Max Consecutive Ones III
- Max Sum of Rectangle No Larger Than K
- Maximize Number of Subsequences in a String
- Maximize Subarrays After Removing One Conflicting Pair
- Maximize the Beauty of the Garden
- Maximize the Confusion of an Exam
- Maximize the Minimum Powered City
- Maximum Average Subarray II
- Maximum Coins From K Consecutive Bags
- Maximum Coins Heroes Can Collect
- Maximum Difference Between Even and Odd Frequency II
- Maximum Frequency After Subarray Operation
- Maximum Frequency of an Element After Performing Operations I
- Maximum Frequency of an Element After Performing Operations II
- Maximum Fruits Harvested After At Most K Steps
- Maximum Good Subarray Sum
- Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
- Maximum Number of Robots Within Budget
- Maximum Number of Ways to Partition an Array
- Maximum OR
- Maximum Points You Can Obtain from Cards
- Maximum Population Year
- Maximum Score After Splitting a String
- Maximum Score From Grid Operations
- Maximum Segment Sum After Removals
- Maximum Side Length of a Square with Sum Less than or Equal to Threshold
- Maximum Size Subarray Sum Equals k
- Maximum Strength of K Disjoint Subarrays
- Maximum Subarray Min-Product
- Maximum Subarray Sum With Length Divisible by K
- Maximum Sum Obtained of Any Permutation
- Maximum Sum of 3 Non-Overlapping Subarrays
- Maximum Sum of an Hourglass
- Maximum Sum Score of Array
- Maximum Total Area Occupied by Pistons
- Maximum Total Beauty of the Gardens
- Maximum Trailing Zeros in a Cornered Path
- Maximum Value of K Coins From Piles
- Maximum White Tiles Covered by a Carpet
- Maximum XOR for Each Query
- Meeting Rooms II
- Minimize Maximum of Array
- Minimum Adjacent Swaps for K Consecutive Ones
- Minimum Amount of Time to Collect Garbage
- Minimum Array Changes to Make Differences Equal
- Minimum Average Difference
- Minimum Cost to Divide Array Into Subarrays
- Minimum Cost to Make Array Equal
- Minimum Cost to Merge Stones
- Minimum Levels to Gain More Points
- Minimum Moves to Make Array Complementary
- Minimum Moves to Pick K Ones
- Minimum Number of K Consecutive Bit Flips
- Minimum Number of Operations to Move All Balls to Each Box
- Minimum Operations to Make All Array Elements Equal
- Minimum Operations to Make Binary Array Elements Equal to One I
- Minimum Operations to Reduce X to Zero
- Minimum Penalty for a Shop
- Minimum Positive Sum Subarray
- Minimum Relative Loss After Buying Chocolates
- Minimum Size Subarray in Infinite Array
- Minimum Size Subarray Sum
- Minimum Space Wasted From Packaging
- Minimum Value to Get Positive Step by Step Sum
- Minimum White Tiles After Covering With Carpets
- Movement of Robots
- My Calendar II
- My Calendar III
- Number of Divisible Substrings
- Number of Flowers in Full Bloom
- Number of Same-End Substrings
- Number of Sub-arrays With Odd Sum
- Number of Submatrices That Sum to Target
- Number of Substrings With Fixed Ratio
- Number of Ways of Cutting a Pizza
- Number of Ways to Select Buildings
- Number of Ways to Split Array
- Number of Wonderful Substrings
- Palindrome Rearrangement Queries
- Plates Between Candles
- Points That Intersect With Cars
- Power of Heroes
- Product of Array Except Self
- Product of the Last K Numbers
- Random Pick with Weight
- Random Point in Non-overlapping Rectangles
- Range Addition
- Range Product Queries of Powers
- Range Sum of Sorted Subarray Sums
- Range Sum Query 2D - Immutable
- Range Sum Query - Immutable
- Rearrange Array to Maximize Prefix Score
- Removing Minimum Number of Magic Beans
- Running Sum of 1d Array
- Shift Distance Between Two Strings
- Shifting Letters II
- Shifting Letters
- Shortest Subarray with Sum at Least K
- Smallest Rotation with Highest Score
- Sorted GCD Pair Queries
- Special Array II
- Split Array Largest Sum
- Split Array with Equal Sum
- Stamping the Grid
- Stone Game II
- Stone Game VIII
- Subarray Product Less Than K
- Subarray Sum Equals K
- Subarray Sums Divisible by K
- Substrings That Begin and End With the Same Letter
- Sum of Absolute Differences in a Sorted Array
- Sum of All Odd Length Subarrays
- Sum of Distances
- Sum of Floored Pairs
- Sum of K Subarrays With Length at Least M
- Sum of Total Strength of Wizards
- Sum of Variable Length Subarrays
- Taking Maximum Energy From the Mystic Dungeon
- Unique Length-3 Palindromic Subsequences
- Valid Permutations for DI Sequence
- Ways to Make a Fair Array
- Ways to Split Array Into Three Subarrays
- Widest Pair of Indices With Equal Range Sum
- XOR Queries of a Subarray
- Zero Array Transformation I
- Zero Array Transformation II
- Zero Array Transformation III