Sort Pattern

Master the Sort coding pattern with curated problems.

#Title
218The Skyline Problem
493Reverse Pairs
506Relative Ranks
522Longest Uncommon Subsequence II
524Longest Word in Dictionary through Deleting
857Minimum Cost to Hire K Workers
871Minimum Number of Refueling Stops
1329Sort the Matrix Diagonally
1333Filter Restaurants by Vegan-Friendly, Price and Distance
1353Maximum Number of Events That Can Be Attended
1370Increasing Decreasing String
1626Best Team With No Conflicts
1727Largest Submatrix With Rearrangements
1847Closest Room
1851Minimum Interval to Include Each Query
1859Sorting the Sentence
1887Reduction Operations to Make the Array Elements Equal
1893Check if All the Integers in a Range Are Covered
2070Most Beautiful Item for Each Query
2144Minimum Cost of Buying Candies With Discount
2146K Highest Ranked Items Within a Price Range
2171Removing Minimum Number of Magic Beans
2191Sort the Jumbled Numbers
2225Find Players With Zero or One Losses
2229Check if an Array Is Consecutive
2233Maximum Product After K Increments
2234Maximum Total Beauty of the Gardens
2268Minimum Number of Keypresses
2273Find Resultant Array After Removing Anagrams
2274Maximum Consecutive Floors Without Special Floors
2279Maximum Bags With Full Capacity of Rocks
2280Minimum Lines to Represent a Line Chart
2343Query Kth Smallest Trimmed Number
2345Finding the Number of Visible Mountains
2354Number of Excellent Pairs
2363Merge Similar Items
2371Minimize Maximum Value in a Grid
2389Longest Subsequence With Limited Sum
2406Divide Intervals Into Minimum Number of Groups
2410Maximum Matching of Players With Trainers
2418Sort the People
2421Number of Good Paths
2449Minimum Number of Operations to Make Arrays Similar
2459Sort Array by Moving Items to Empty Space
2463Minimum Total Distance Traveled
2471Minimum Number of Operations to Sort a Binary Tree by Level
2497Maximum Star Sum of a Graph
2545Sort the Students by Their Kth Score
2548Maximum Price to Fill a Bag
2563Count the Number of Fair Pairs
2567Minimum Score by Changing Two Elements
2576Find the Maximum Number of Marked Indices
2578Split With Minimum Sum
2580Count Ways to Group Overlapping Ranges
2587Rearrange Array to Maximize Prefix Score
2589Minimum Time to Complete All Tasks
2592Maximize Greatness of an Array
2593Find Score of an Array After Marking All Elements
2602Minimum Operations to Make All Array Elements Equal
2616Minimize the Maximum Difference of Pairs
2655Find Maximal Uncovered Ranges
2659Make Array Empty
2679Sum in a Matrix
2681Power of Heroes
2713Maximum Strictly Increasing Cells in a Matrix
2722Join Two Arrays by ID
2724Sort By
2731Movement of Robots
2736Maximum Sum Queries
2740Find the Value of the Partition
2747Count Zero Request Servers
2751Robot Collisions
2766Relocate Marbles
2779Maximum Beauty of an Array After Applying Operation
2809Minimum Time to Make Array Sum At Most x
2818Apply Operations to Maximize Score
2819Minimum Relative Loss After Buying Chocolates
2824Count Pairs Whose Sum is Less than Target
2835Minimum Operations to Form Subsequence With Target Sum
2838Maximum Coins Heroes Can Collect
2848Points That Intersect With Cars
2860Happy Students
2861Maximum Number of Alloys
2863Maximum Length of Semi-Decreasing Subarrays
2895Minimum Processing Time
2932Maximum Strong Pair XOR I
2933High-Access Employees
2935Maximum Strong Pair XOR II
2943Maximize Area of Square Hole in Grid
2948Make Lexicographically Smallest Array by Swapping Elements
2952Minimum Number of Coins to be Added
2966Divide Array Into Arrays With Max Difference
2967Minimum Cost to Make Array Equalindromic
2968Apply Operations to Maximize Frequency Score
2971Find Polygon With the Largest Perimeter
2974Minimum Number Game
3009Maximum Number of Intersections on the Chart
3011Find if Array Can Be Sorted
3025Find the Number of Ways to Place People I
3027Find the Number of Ways to Place People II
3035Maximum Palindromes After Operations
3041Maximize Consecutive Elements in an Array After Modification
3074Apple Redistribution into Boxes
3075Maximize Happiness of Selected Children
3107Minimum Operations to Make Median of Array Equal to K
3111Minimum Rectangles to Cover Points
3119Maximum Number of Potholes That Can Be Fixed
3132Find the Integer Added to Array II
3169Count Days Without Meetings
3180Maximum Total Reward Using Operations I
3181Maximum Total Reward Using Operations II
3186Maximum Total Damage With Spell Casting
3194Minimum Average of Smallest and Largest Elements
3264Final Array State After K Multiplication Operations I
3266Final Array State After K Multiplication Operations II
3273Minimum Amount of Damage Dealt to Bob
3288Length of the Longest Increasing Path
3301Maximize the Total Height of Unique Towers
3309Maximum Possible Number by Binary Concatenation
3323Minimize Connected Groups by Inserting Interval
3346Maximum Frequency of an Element After Performing Operations I
3347Maximum Frequency of an Element After Performing Operations II
3362Zero Array Transformation III
3380Maximum Area Rectangle With Point Constraints I
3382Maximum Area Rectangle With Point Constraints II
3394Check if Grid can be Cut into Sections
3397Maximum Number of Distinct Elements After Operations
3413Maximum Coins From K Consecutive Bags
3424Minimum Cost to Make Arrays Identical
3428Maximum and Minimum Sums of at Most Size K Subsequences
3431Minimum Unlocked Indices to Sort Nums
3446Sort Matrix by Diagonals
3453Separate Squares I
3454Separate Squares II
3457Eat Pizzas!
3458Select K Disjoint Special Substrings
3464Maximize the Distance Between Points on a Square
3476Maximize Profit from Task Assignment
3478Choose K Elements With Maximum Sum
3485Longest Common Prefix of K Strings After Removal
3491Phone Number Prefix
3551Minimum Swaps to Sort by Digit Sum
3567Minimum Absolute Difference in Sliding Submatrix
3606Coupon Code Validator
3607Power Grid Maintenance
3608Minimum Time for K Connected Components
3613Minimize Maximum Component Cost
3627Maximum Median Sum of Subsequences of Size 3
3631Sort Threats by Severity and Exploitability
3634Minimum Removals to Balance Array
3636Threshold Majority Queries
3644Maximum K to Sort a Permutation
3645Maximum Total from Optimal Activation Order
3646Next Special Palindrome Number
3649Number of Perfect Pairs
3656Determine if a Simple Graph Exists
3661Maximum Walls Destroyed by Robots
3667Sort Array By Absolute Value
3684Maximize Sum of At Most K Distinct Elements
3685Subsequence Sum After Capping Elements
3691Maximum Total Subarray Value II
3710Maximum Partition Factor
3727Maximum Alternating Sum of Squares
3730Maximum Calories Burnt from Jumps
3759Count Elements With at Least K Greater Values
3763Maximum Total Sum with Threshold Constraints
3767Maximize Points After Choosing K Tasks
3768Minimum Inversion Count in Subarrays of Fixed Length
3769Sort Integers by Binary Reflection
3774Absolute Difference Between Maximum and Minimum K Elements
3780Maximum Sum of Three Numbers Divisible by Three
3799Word Squares II
3801Minimum Cost to Merge Sorted Lists
3806Maximum Bitwise AND After Increment Operations
3814Maximum Capacity Within Budget
3842Toggle Light Bulbs
3851Maximum Requests Without Violating the Limit
3867Sum of GCD of Formed Pairs
3890Integers With Multiple Sum of Two Cubes
3893Maximum Team Size with Overlapping Intervals
3905Multi Source Flood Fill
3907Count Smaller Elements With Opposite Parity
3913Sort Vowels by Frequency
3920Maximize Fixed Points After Deletions
3930Power Update After K-th Largest Insertion II
3947Maximum Number of Items From Sale II
3951Minimum Energy to Maintain Brightness
3960Frequency Balance Subarray
3974Maximum Total Sum of K Selected Elements
3975Filter Occupied Intervals
3989Maximum Consistent Columns in a Grid