Tag: sorting
- 3Sum Closest
- 3Sum Smaller
- 3Sum With Multiplicity
- 3Sum
- 4Sum
- Accounts Merge
- Advantage Shuffle
- Alert Using Same Key-Card Three or More Times in a One Hour Period
- All Elements in Two Binary Search Trees
- Allocate Mailboxes
- Analyze User Website Visit Pattern
- Append K Integers With Minimal Sum
- Apple Redistribution into Boxes
- Apply Operations to Make String Empty
- Apply Operations to Maximize Frequency Score
- Apply Operations to Maximize Score
- Arithmetic Subarrays
- Array of Doubled Pairs
- Array Partition
- Array With Elements Not Equal to Average of Neighbors
- Assign Cookies
- Average Height of Buildings in Each Segment
- Average Salary Excluding the Minimum and Maximum Salary
- Bag of Tokens
- Beautiful Pairs
- Before and After Puzzle
- Best Meeting Point
- Best Team With No Conflicts
- Better Compression of String
- Binary Tree Vertical Order Traversal
- Binary Trees With Factors
- Boats to Save People
- Brightest Position on Street
- Buy Two Chocolates
- Campus Bikes
- Can Make Arithmetic Progression From Sequence
- Car Fleet
- Car Pooling
- Check If a String Can Break Another String
- Check if an Array Is Consecutive
- Check if Array is Good
- Check if Grid can be Cut into Sections
- Check If N and Its Double Exist
- Check If String Is Transformable With Substring Sort Operations
- Check if Strings Can be Made Equal With Operations II
- Checking Existence of Edge Length Limited Paths
- Choose K Elements With Maximum Sum
- Closest Room
- Closest Subsequence Sum
- Compare Strings by Frequency of the Smallest Character
- Contains Duplicate III
- Contains Duplicate
- Count Almost Equal Pairs I
- Count Almost Equal Pairs II
- Count Days Without Meetings
- Count Elements With Strictly Smaller and Greater Elements
- Count Mentions Per User
- Count Number of Rectangles Containing Each Point
- Count Pairs in Two Arrays
- Count Pairs Of Nodes
- Count Pairs Whose Sum is Less than Target
- Count the Number of Fair Pairs
- Count the Number of K-Free Subsets
- Count Ways to Group Overlapping Ranges
- Count Words Obtained After Adding a Letter
- Count Zero Request Servers
- Course Schedule III
- Custom Sort String
- Delete Greatest Value in Each Row
- Describe the Painting
- Design a File Sharing System
- Design A Leaderboard
- Design a Todo List
- Design In-Memory File System
- Design Search Autocomplete System
- Destroying Asteroids
- Determine if Two Strings Are Close
- Diagonal Traverse II
- Display Table of Food Orders in a Restaurant
- Distant Barcodes
- Divide an Array Into Subarrays With Minimum Cost I
- Divide Array in Sets of K Consecutive Numbers
- Divide Array Into Arrays With Max Difference
- Divide Intervals Into Minimum Number of Groups
- Divide Players Into Teams of Equal Skill
- Earliest Possible Day of Full Bloom
- Eat Pizzas!
- Eliminate Maximum Number of Monsters
- Employee Free Time
- Fair Candy Swap
- Filter Restaurants by Vegan-Friendly, Price and Distance
- Find All People With Secret
- Find And Replace in String
- Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree
- Find if Array Can Be Sorted
- Find K Closest Elements
- Find K-th Smallest Pair Distance
- Find Kth Largest XOR Coordinate Value
- Find Maximal Uncovered Ranges
- Find Median from Data Stream
- Find Minimum Time to Finish All Jobs II
- Find Number of Coins to Place in Tree Nodes
- Find Original Array From Doubled Array
- Find Players With Zero or One Losses
- Find Polygon With the Largest Perimeter
- Find Resultant Array After Removing Anagrams
- Find Right Interval
- Find Score of an Array After Marking All Elements
- Find Subsequence of Length K With the Largest Sum
- Find Target Indices After Sorting Array
- Find the Difference
- Find the Distance Value Between Two Arrays
- Find the Integer Added to Array II
- Find the K-Sum of an Array
- Find the Kth Largest Integer in the Array
- Find the Maximum Number of Marked Indices
- Find the Maximum Sum of Node Values
- Find the Number of Ways to Place People I
- Find the Number of Ways to Place People II
- Find the Sum of Subsequence Powers
- Find the Value of the Partition
- Finding 3-Digit Even Numbers
- Finding the Number of Visible Mountains
- Frequency of the Most Frequent Element
- Friends Of Appropriate Ages
- GCD Sort of an Array
- Get Biggest Three Rhombus Sums in a Grid
- Get Watched Videos by Your Friends
- Greatest Sum Divisible by Three
- Group Anagrams
- Groups of Special-Equivalent Strings
- H-Index
- Hand of Straights
- Happy Students
- Heaters
- Height Checker
- High-Access Employees
- High Five
- How Many Apples Can You Put into the Basket
- How Many Numbers Are Smaller Than the Current Number
- Index Pairs of a String
- Insertion Sort List
- Intersection of Multiple Arrays
- Intersection of Two Arrays II
- Intersection of Two Arrays
- Invalid Transactions
- IPO
- Jump Game V
- K Closest Points to Origin
- K-diff Pairs in an Array
- K Highest Ranked Items Within a Price Range
- K-th Largest Perfect Subtree Size in Binary Tree
- K-th Smallest Prime Fraction
- Keep Multiplying Found Values by Two
- Kth Largest Element in an Array
- Kth Largest Sum in a Binary Tree
- Kth Smallest Element in a Sorted Matrix
- Largest Divisible Subset
- Largest Multiple of Three
- Largest Number After Digit Swaps by Parity
- Largest Number At Least Twice of Others
- Largest Number
- Largest Perimeter Triangle
- Largest Positive Integer That Exists With Its Negative
- Largest Submatrix With Rearrangements
- Largest Unique Number
- Largest Values From Labels
- Least Number of Unique Integers after K Removals
- Length of the Longest Increasing Path
- Longest Harmonious Subsequence
- Longest Square Streak in an Array
- Longest String Chain
- Longest Subsequence With Limited Sum
- Longest Uncommon Subsequence II
- Longest Word in Dictionary through Deleting
- Longest Word in Dictionary
- Magnetic Force Between Two Balls
- Majority Element II
- Majority Element
- Make Array Empty
- Make Array Strictly Increasing
- Make Array Zero by Subtracting Equal Amounts
- Make K-Subarray Sums Equal
- Make Lexicographically Smallest Array by Swapping Elements
- Make String Anti-palindrome
- Make Two Arrays Equal by Reversing Subarrays
- Mark Elements on Array by Performing Queries
- Matrix Cells in Distance Order
- Max Chunks To Make Sorted II
- Max Chunks To Make Sorted
- Max Number of K-Sum Pairs
- Max Sum of a Pair With Equal Sum of Digits
- Maximize Area of Square Hole in Grid
- Maximize Consecutive Elements in an Array After Modification
- Maximize Greatness of an Array
- Maximize Happiness of Selected Children
- Maximize Profit from Task Assignment
- Maximize Score of Numbers in Ranges
- Maximize Sum Of Array After K Negations
- Maximize the Profit as the Salesman
- Maximize the Total Height of Unique Towers
- Maximum and Minimum Sums of at Most Size K Subsequences
- Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
- Maximum Area Rectangle With Point Constraints I
- Maximum Area Rectangle With Point Constraints II
- Maximum Bags With Full Capacity of Rocks
- Maximum Beauty of an Array After Applying Operation
- Maximum Building Height
- Maximum Coins From K Consecutive Bags
- Maximum Coins Heroes Can Collect
- Maximum Consecutive Floors Without Special Floors
- Maximum Earnings From Taxi
- Maximum Elegance of a K-Length Subsequence
- Maximum Element After Decreasing and Rearranging
- Maximum Frequency of an Element After Performing Operations I
- Maximum Frequency of an Element After Performing Operations II
- Maximum Gap
- Maximum Height by Stacking Cuboids
- Maximum Ice Cream Bars
- Maximum Length of Pair Chain
- Maximum Length of Semi-Decreasing Subarrays
- Maximum Matching of Players With Trainers
- Maximum Number of Coins You Can Get
- Maximum Number of Consecutive Values You Can Make
- Maximum Number of Distinct Elements After Operations
- Maximum Number of Events That Can Be Attended II
- Maximum Number of Events That Can Be Attended
- Maximum Number of Groups With Increasing Length
- Maximum Number of Integers to Choose From a Range I
- Maximum Number of Integers to Choose From a Range II
- Maximum Number of Ones
- Maximum Number of Points From Grid Queries
- Maximum Number of Potholes That Can Be Fixed
- Maximum Number of Tasks You Can Assign
- Maximum Number of Visible Points
- Maximum Number That Makes Result of Bitwise AND Zero
- Maximum Palindromes After Operations
- Maximum Performance of a Team
- Maximum Points Inside the Square
- Maximum Price to Fill a Bag
- Maximum Product Difference Between Two Pairs
- Maximum Product of Three Numbers
- Maximum Product of Two Elements in an Array
- Maximum Profit in Job Scheduling
- Maximum Running Time of N Computers
- Maximum Score of a Node Sequence
- Maximum Score of Non-overlapping Intervals
- Maximum Spending After Buying Items
- Maximum Star Sum of a Graph
- Maximum Strength of a Group
- Maximum Strictly Increasing Cells in a Matrix
- Maximum Subsequence Score
- Maximum Sum Obtained of Any Permutation
- Maximum Sum Queries
- Maximum Sum With at Most K Elements
- Maximum Tastiness of Candy Basket
- Maximum Total Beauty of the Gardens
- Maximum Total Damage With Spell Casting
- Maximum Total Importance of Roads
- Maximum Units on a Truck
- Maximum White Tiles Covered by a Carpet
- Mean of Array After Removing Some Elements
- Meeting Rooms II
- Meeting Rooms III
- Meeting Rooms
- Meeting Scheduler
- Merge Intervals
- Merge Similar Items
- Merge Sorted Array
- Mice and Cheese
- Minimize Connected Groups by Inserting Interval
- Minimize Manhattan Distances
- Minimize Maximum Pair Sum in Array
- Minimize Maximum Value in a Grid
- Minimize Product Sum of Two Arrays
- Minimize Rounding Error to Meet Target
- Minimum Absolute Difference
- Minimum Absolute Sum Difference
- Minimum Amount of Damage Dealt to Bob
- Minimum Amount of Time to Fill Cups
- Minimum Area Rectangle
- Minimum Average of Smallest and Largest Elements
- Minimum Cost for Cutting Cake I
- Minimum Cost for Cutting Cake II
- Minimum Cost of Buying Candies With Discount
- Minimum Cost to Cut a Stick
- Minimum Cost to Hire K Workers
- Minimum Cost to Make Array Equal
- Minimum Cost to Make Array Equalindromic
- Minimum Cost to Make Arrays Identical
- Minimum Deletions to Make Array Divisible
- Minimum Deletions to Make Character Frequencies Unique
- Minimum Deletions to Make String K-Special
- Minimum Difference Between Highest and Lowest of K Scores
- Minimum Difference Between Largest and Smallest Value in Three Moves
- Minimum Increment to Make Array Unique
- Minimum Index of a Valid Split
- Minimum Initial Energy to Finish Tasks
- Minimum Interval to Include Each Query
- Minimum Lines to Represent a Line Chart
- Minimum Money Required Before Transactions
- Minimum Moves to Equal Array Elements II
- Minimum Moves to Get a Peaceful Board
- Minimum Number Game
- Minimum Number of Arrows to Burst Balloons
- Minimum Number of Coins to be Added
- Minimum Number of Keypresses
- Minimum Number of Moves to Seat Everyone
- Minimum Number of Operations to Make Arrays Similar
- Minimum Number of Pushes to Type Word II
- Minimum Operations to Make a Uni-Value Grid
- Minimum Operations to Make All Array Elements Equal
- Minimum Operations to Make Median of Array Equal to K
- Minimum Processing Time
- Minimum Rectangles to Cover Points
- Minimum Relative Loss After Buying Chocolates
- Minimum Score by Changing Two Elements
- Minimum Space Wasted From Packaging
- Minimum Subsequence in Non-Increasing Order
- Minimum Sum of Four Digit Number After Splitting Digits
- Minimum Sum of Squared Difference
- Minimum Time Difference
- Minimum Time to Complete All Tasks
- Minimum Time to Eat All Grains
- Minimum Time to Make Array Sum At Most x
- Minimum Total Distance Traveled
- Missing Number
- Most Beautiful Item for Each Query
- Most Popular Video Creator
- Most Profit Assigning Work
- Movement of Robots
- Moving Stones Until Consecutive II
- Neither Minimum nor Maximum
- Next Greater Element IV
- Non-overlapping Intervals
- Number of Atoms
- Number of Distinct Averages
- Number of Flowers in Full Bloom
- Number of Good Paths
- Number of Matching Subsequences
- Number of Subsequences That Satisfy the Given Sum Condition
- Number of Unequal Triplets in Array
- Orderly Queue
- Pancake Sorting
- Partition Array Such That Maximum Difference Is K
- Permutations II
- Phone Number Prefix
- Power of Heroes
- Put Boxes Into the Warehouse I
- Put Boxes Into the Warehouse II
- Put Marbles in Bags
- Query Kth Smallest Trimmed Number
- Queue Reconstruction by Height
- Random Pick with Blacklist
- Range Sum of Sorted Subarray Sums
- Rank Teams by Votes
- Rank Transform of a Matrix
- Rank Transform of an Array
- Rearrange Array to Maximize Prefix Score
- Rearrange K Substrings to Form Target String
- Rearrange String k Distance Apart
- Rearrange Words in a Sentence
- Recover the Original Array
- Reduce Array Size to The Half
- Reducing Dishes
- Reduction Operations to Make the Array Elements Equal
- Relative Ranks
- Relative Sort Array
- Relocate Marbles
- Remove Covered Intervals
- Removing Minimum Number of Magic Beans
- Reorder Data in Log Files
- Reordered Power of 2
- Reorganize String
- Replace Question Marks in String to Minimize Its Value
- Reveal Cards In Increasing Order
- Reward Top K Students
- Robot Collisions
- Russian Doll Envelopes
- Search Suggestions System
- Select K Disjoint Special Substrings
- Sell Diminishing-Valued Colored Balls
- Set Intersection Size At Least Two
- Set Mismatch
- Shortest Unsorted Continuous Subarray
- Single-Threaded CPU
- Smallest Missing Integer Greater Than Sequential Prefix Sum
- Smallest Range Covering Elements from K Lists
- Smallest Range II
- Smallest String With Swaps
- Smallest Value of the Rearranged Number
- Sort an Array
- Sort Array by Increasing Frequency
- Sort Array by Moving Items to Empty Space
- Sort Array By Parity II
- Sort Array By Parity
- Sort Characters By Frequency
- Sort Colors
- Sort Even and Odd Indices Independently
- Sort Features by Popularity
- Sort Integers by The Number of 1 Bits
- Sort Integers by The Power Value
- Sort Linked List Already Sorted Using Absolute Values
- Sort List
- Sort Matrix by Diagonals
- Sort the Jumbled Numbers
- Sort the Matrix Diagonally
- Sort the People
- Sort the Students by Their Kth Score
- Sort Transformed Array
- Sort Vowels in a String
- Sorting the Sentence
- Special Array With X Elements Greater Than or Equal X
- Split With Minimum Sum
- Squares of a Sorted Array
- Stone Game VI
- Subsequence of Size K With the Largest Even Sum
- Successful Pairs of Spells and Potions
- Sum in a Matrix
- Sum of Mutated Array Closest to Target
- Sum of Subsequence Widths
- Task Scheduler
- The Earliest Moment When Everyone Become Friends
- The k Strongest Values in an Array
- The K Weakest Rows in a Matrix
- The Latest Time to Catch a Bus
- The Number of Beautiful Subsets
- The Number of Weak Characters in the Game
- Third Maximum Number
- Top K Frequent Elements
- Top K Frequent Words
- Transform Array by Parity
- Tweet Counts Per Frequency
- Two Best Non-Overlapping Events
- Two City Scheduling
- Two Sum Less Than K
- Type of Triangle
- Valid Anagram
- Valid Triangle Number
- Vertical Order Traversal of a Binary Tree
- Widest Vertical Area Between Two Points Containing No Points
- Wiggle Sort II
- Wiggle Sort
- Word Abbreviation
- Zero Array Transformation III