GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing leetcodejavascript.com — Sorting LeetCode Problems | JavaScript Solutions

Sorting | LeetCode Problems

384 Sorting solutions to LeetCode solutions.

View Source Code on GitHub
All 2765 Array 1587 String 683 Hash Table 587 Math 485 Dynamic Programming 458 Sorting 384 Greedy 348 Depth-First Search 293 Binary Search 241 Tree 227 Breadth-First Search 224 Matrix 223 Two Pointers 200 Bit Manipulation 197 Binary Tree 175 Prefix Sum 159 Stack 154 Heap Priority Queue 152 Simulation 150 Counting 134 Graph 133 Design 123 Sliding Window 112 Backtracking 104 Union Find 79 Enumeration 78 Linked List 78 Ordered Set 60 Monotonic Stack 55 Trie 51 Number Theory 47 Divide and Conquer 46 Recursion 45 Bitmask 41 Queue 41 Binary Search Tree 40 Segment Tree 38 Memoization 36 Geometry 36 Combinatorics 35 Topological Sort 33 Hash Function 30 Binary Indexed Tree 28 Game Theory 26 String Matching 23 Shortest Path 23 Interactive 23 Rolling Hash 22 Data Stream 20 Brainteaser 16 Monotonic Queue 14 Randomized 12 Merge Sort 12 Doubly-Linked List 11 Counting Sort 10 Iterator 9 Probability and Statistics 7 Quickselect 7 Suffix Array 6 Bucket Sort 6 Line Sweep 5 Minimum Spanning Tree 5 Reservoir Sampling 4 Strongly Connected Component 3 Eulerian Circuit 3 Radix Sort 3 Rejection Sampling 2 Biconnected Component 1

Sorting Problems View all solutions →

3Sum

#15 Medium

3Sum Closest

#16 Medium

4Sum

#18 Medium

Permutations II

#47 Medium

Group Anagrams

#49 Medium

Merge Intervals

#56 Medium

Sort Colors

#75 Medium

Merge Sorted Array

#88 Easy

Insertion Sort List

#147 Medium

Sort List

#148 Medium

Maximum Gap

#164 Medium

Majority Element

#169 Easy

Largest Number

#179 Medium

Kth Largest Element in an Array

#215 Medium

Contains Duplicate

#217 Easy

Contains Duplicate III

#220 Hard

Majority Element II

#229 Medium

Valid Anagram

#242 Easy

Meeting Rooms

#252 Easy

Meeting Rooms II

#253 Medium

3Sum Smaller

#259 Medium

Missing Number

#268 Easy

H-Index

#274 Medium

Wiggle Sort

#280 Medium

Find Median from Data Stream

#295 Hard

Best Meeting Point

#296 Hard

Binary Tree Vertical Order Traversal

#314 Medium

Wiggle Sort II

#324 Medium

Top K Frequent Elements

#347 Medium

Intersection of Two Arrays

#349 Easy

Intersection of Two Arrays II

#350 Easy

Russian Doll Envelopes

#354 Hard

Rearrange String k Distance Apart

#358 Hard

Sort Transformed Array

#360 Medium

Largest Divisible Subset

#368 Medium

Kth Smallest Element in a Sorted Matrix

#378 Medium

Find the Difference

#389 Easy

Queue Reconstruction by Height

#406 Medium

Third Maximum Number

#414 Easy

Non-overlapping Intervals

#435 Medium

Find Right Interval

#436 Medium

Sort Characters By Frequency

#451 Medium

Minimum Number of Arrows to Burst Balloons

#452 Medium

Assign Cookies

#455 Easy

Minimum Moves to Equal Array Elements II

#462 Medium

Heaters

#475 Medium

IPO

#502 Hard

Relative Ranks

#506 Easy

Longest Uncommon Subsequence II

#522 Medium

Longest Word in Dictionary through Deleting

#524 Medium

Word Abbreviation

#527 Hard

K-diff Pairs in an Array

#532 Medium

Minimum Time Difference

#539 Medium

Array Partition

#561 Easy

Shortest Unsorted Continuous Subarray

#581 Medium

Design In-Memory File System

#588 Hard

Longest Harmonious Subsequence

#594 Easy

Valid Triangle Number

#611 Medium

Task Scheduler

#621 Medium

Maximum Product of Three Numbers

#628 Easy

Course Schedule III

#630 Hard

Smallest Range Covering Elements from K Lists

#632 Hard

Design Search Autocomplete System

#642 Hard

Set Mismatch

#645 Medium

Maximum Length of Pair Chain

#646 Medium

Find K Closest Elements

#658 Medium

Top K Frequent Words

#692 Medium

Random Pick with Blacklist

#710 Hard

Find K-th Smallest Pair Distance

#719 Hard

Longest Word in Dictionary

#720 Medium

Accounts Merge

#721 Medium

Number of Atoms

#726 Hard

Largest Number At Least Twice of Others

#747 Easy

Set Intersection Size At Least Two

#757 Hard

Employee Free Time

#759 Hard

Reorganize String

#767 Medium

Max Chunks To Make Sorted II

#768 Hard

Max Chunks To Make Sorted

#769 Medium

K-th Smallest Prime Fraction

#786 Medium

Custom Sort String

#791 Medium

Number of Matching Subsequences

#792 Medium

Binary Trees With Factors

#823 Medium

Friends Of Appropriate Ages

#825 Medium

Most Profit Assigning Work

#826 Medium

Find And Replace in String

#833 Medium

Hand of Straights

#846 Medium

Car Fleet

#853 Medium

Minimum Cost to Hire K Workers

#857 Hard

Reordered Power of 2

#869 Medium

Advantage Shuffle

#870 Medium

Boats to Save People

#881 Medium

Fair Candy Swap

#888 Easy

Sum of Subsequence Widths

#891 Hard

Groups of Special-Equivalent Strings

#893 Medium

Orderly Queue

#899 Hard

Sort Array By Parity

#905 Easy

Smallest Range II

#910 Medium

Sort an Array

#912 Medium

Sort Array By Parity II

#922 Easy

3Sum With Multiplicity

#923 Medium

Reorder Data in Log Files

#937 Medium

Minimum Area Rectangle

#939 Medium

Minimum Increment to Make Array Unique

#945 Medium

Bag of Tokens

#948 Medium

Reveal Cards In Increasing Order

#950 Medium

Array of Doubled Pairs

#954 Medium

Pancake Sorting

#969 Medium

K Closest Points to Origin

#973 Medium

Largest Perimeter Triangle

#976 Easy

Squares of a Sorted Array

#977 Easy

Vertical Order Traversal of a Binary Tree

#987 Hard

Maximize Sum Of Array After K Negations

#1005 Easy

Two City Scheduling

#1029 Medium

Matrix Cells in Distance Order

#1030 Easy

Moving Stones Until Consecutive II

#1040 Medium

Longest String Chain

#1048 Medium

Height Checker

#1051 Easy

Distant Barcodes

#1054 Medium

Campus Bikes

#1057 Medium

Minimize Rounding Error to Meet Target

#1058 Medium

Index Pairs of a String

#1065 Easy

High Five

#1086 Easy

Largest Values From Labels

#1090 Medium

Car Pooling

#1094 Medium

Two Sum Less Than K

#1099 Easy

The Earliest Moment When Everyone Become Friends

#1101 Medium

Relative Sort Array

#1122 Easy

Largest Unique Number

#1133 Easy

Analyze User Website Visit Pattern

#1152 Medium

Invalid Transactions

#1169 Medium

Compare Strings by Frequency of the Smallest Character

#1170 Medium

Before and After Puzzle

#1181 Medium

Maximum Number of Ones

#1183 Hard

Make Array Strictly Increasing

#1187 Hard

How Many Apples Can You Put into the Basket

#1196 Easy

Minimum Absolute Difference

#1200 Easy

Smallest String With Swaps

#1202 Medium

Meeting Scheduler

#1229 Medium

Maximum Profit in Job Scheduling

#1235 Hard

Design A Leaderboard

#1244 Medium

Greatest Sum Divisible by Three

#1262 Medium

Search Suggestions System

#1268 Medium

Remove Covered Intervals

#1288 Medium

Divide Array in Sets of K Consecutive Numbers

#1296 Medium

Sum of Mutated Array Closest to Target

#1300 Medium

All Elements in Two Binary Search Trees

#1305 Medium

Get Watched Videos by Your Friends

#1311 Medium

Sort the Matrix Diagonally

#1329 Medium

Rank Transform of an Array

#1331 Easy

Filter Restaurants by Vegan-Friendly, Price and Distance

#1333 Medium

The K Weakest Rows in a Matrix

#1337 Easy

Reduce Array Size to The Half

#1338 Medium

Jump Game V

#1340 Hard

Check If N and Its Double Exist

#1346 Easy

Tweet Counts Per Frequency

#1348 Medium

Maximum Number of Events That Can Be Attended

#1353 Medium

Sort Integers by The Number of 1 Bits

#1356 Easy

Largest Multiple of Three

#1363 Hard

How Many Numbers Are Smaller Than the Current Number

#1365 Easy

Rank Teams by Votes

#1366 Medium

Maximum Performance of a Team

#1383 Hard

Find the Distance Value Between Two Arrays

#1385 Easy

Sort Integers by The Power Value

#1387 Medium

Reducing Dishes

#1402 Hard

Minimum Subsequence in Non-Increasing Order

#1403 Easy

Display Table of Food Orders in a Restaurant

#1418 Medium

Diagonal Traverse II

#1424 Medium

Check If a String Can Break Another String

#1433 Medium

Rearrange Words in a Sentence

#1451 Medium

Make Two Arrays Equal by Reversing Sub-arrays

#1460 Easy

Maximum Product of Two Elements in an Array

#1464 Easy

Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts

#1465 Medium

The k Strongest Values in an Array

#1471 Medium

Allocate Mailboxes

#1478 Hard

Least Number of Unique Integers after K Removals

#1481 Medium

Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree

#1489 Hard

Average Salary Excluding the Minimum and Maximum Salary

#1491 Easy

Number of Subsequences That Satisfy the Given Sum Condition

#1498 Medium

Design a File Sharing System

#1500 Medium

Can Make Arithmetic Progression From Sequence

#1502 Easy

Range Sum of Sorted Subarray Sums

#1508 Medium

Minimum Difference Between Largest and Smallest Value in Three Moves

#1509 Medium

Minimum Cost to Cut a Stick

#1547 Hard

Magnetic Force Between Two Balls

#1552 Medium

Maximum Number of Coins You Can Get

#1561 Medium

Put Boxes Into the Warehouse I

#1564 Medium

Put Boxes Into the Warehouse II

#1580 Medium

Check If String Is Transformable With Substring Sort Operations

#1585 Hard

Maximum Sum Obtained of Any Permutation

#1589 Medium

Alert Using Same Key-Card Three or More Times in a One Hour Period

#1604 Medium

Special Array With X Elements Greater Than or Equal X

#1608 Easy

Maximum Number of Visible Points

#1610 Hard

Mean of Array After Removing Some Elements

#1619 Easy

Best Team With No Conflicts

#1626 Medium

Arithmetic Subarrays

#1630 Medium

Rank Transform of a Matrix

#1632 Hard

Sort Array by Increasing Frequency

#1636 Easy

Widest Vertical Area Between Two Points Containing No Points

#1637 Easy

Minimum Deletions to Make Character Frequencies Unique

#1647 Medium

Sell Diminishing-Valued Colored Balls

#1648 Medium

Determine if Two Strings Are Close

#1657 Medium

Minimum Initial Energy to Finish Tasks

#1665 Hard

Max Number of K-Sum Pairs

#1679 Medium

Stone Game VI

#1686 Medium

Maximum Height by Stacking Cuboids

#1691 Hard

Checking Existence of Edge Length Limited Paths

#1697 Hard

Maximum Units on a Truck

#1710 Easy

Largest Submatrix With Rearrangements

#1727 Medium

Find Kth Largest XOR Coordinate Value

#1738 Medium

Maximum Number of Events That Can Be Attended II

#1751 Hard

Closest Subsequence Sum

#1755 Hard

Sort Features by Popularity

#1772 Medium

Count Pairs Of Nodes

#1782 Hard

Maximum Number of Consecutive Values You Can Make

#1798 Medium

Minimum Absolute Sum Difference

#1818 Medium

Maximum Ice Cream Bars

#1833 Medium

Single-Threaded CPU

#1834 Medium

Frequency of the Most Frequent Element

#1838 Medium

Maximum Building Height

#1840 Hard

Maximum Element After Decreasing and Rearranging

#1846 Medium

Closest Room

#1847 Hard

Minimum Interval to Include Each Query

#1851 Hard

Sorting the Sentence

#1859 Easy

Minimize Product Sum of Two Arrays

#1874 Medium

Minimize Maximum Pair Sum in Array

#1877 Medium

Get Biggest Three Rhombus Sums in a Grid

#1878 Medium

Count Pairs in Two Arrays

#1885 Medium

Reduction Operations to Make the Array Elements Equal

#1887 Medium

Minimum Space Wasted From Packaging

#1889 Hard

Maximum Product Difference Between Two Pairs

#1913 Easy

Eliminate Maximum Number of Monsters

#1921 Medium

Describe the Painting

#1943 Medium

Array With Elements Not Equal to Average of Neighbors

#1968 Medium

Minimum Difference Between Highest and Lowest of K Scores

#1984 Easy

Find the Kth Largest Integer in the Array

#1985 Medium

The Number of Weak Characters in the Game

#1996 Medium

GCD Sort of an Array

#1998 Hard

Find Original Array From Doubled Array

#2007 Medium

Maximum Earnings From Taxi

#2008 Medium

Average Height of Buildings in Each Segment

#2015 Medium

Brightest Position on Street

#2021 Medium

Minimum Operations to Make a Uni-Value Grid

#2033 Medium

Minimum Number of Moves to Seat Everyone

#2037 Easy

Sort Linked List Already Sorted Using Absolute Values

#2046 Medium

Two Best Non-Overlapping Events

#2054 Medium

Most Beautiful Item for Each Query

#2070 Medium

Maximum Number of Tasks You Can Assign

#2071 Hard

Find Target Indices After Sorting Array

#2089 Easy

Find All People With Secret

#2092 Hard

Finding 3-Digit Even Numbers

#2094 Easy

Subsequence of Size K With the Largest Even Sum

#2098 Medium

Find Subsequence of Length K With the Largest Sum

#2099 Medium

Recover the Original Array

#2122 Hard

Destroying Asteroids

#2126 Medium

Count Words Obtained After Adding a Letter

#2135 Medium

Earliest Possible Day of Full Bloom

#2136 Hard

Maximum Running Time of N Computers

#2141 Hard

Minimum Cost of Buying Candies With Discount

#2144 Easy

K Highest Ranked Items Within a Price Range

#2146 Medium

Count Elements With Strictly Smaller and Greater Elements

#2148 Easy

Keep Multiplying Found Values by Two

#2154 Easy

Minimum Sum of Four Digit Number After Splitting Digits

#2160 Easy

Sort Even and Odd Indices Independently

#2164 Easy

Smallest Value of the Rearranged Number

#2165 Medium

Removing Minimum Number of Magic Beans

#2171 Medium

Sort the Jumbled Numbers

#2191 Medium

Append K Integers With Minimal Sum

#2195 Medium

Find Players With Zero or One Losses

#2225 Medium

Check if an Array Is Consecutive

#2229 Easy

Largest Number After Digit Swaps by Parity

#2231 Easy

Maximum Total Beauty of the Gardens

#2234 Hard

Maximum Score of a Node Sequence

#2242 Hard

Intersection of Multiple Arrays

#2248 Easy

Count Number of Rectangles Containing Each Point

#2250 Medium

Number of Flowers in Full Bloom

#2251 Hard

Minimum Number of Keypresses

#2268 Medium

Maximum White Tiles Covered by a Carpet

#2271 Medium

Find Resultant Array After Removing Anagrams

#2273 Easy

Maximum Consecutive Floors Without Special Floors

#2274 Medium

Maximum Bags With Full Capacity of Rocks

#2279 Medium

Minimum Lines to Represent a Line Chart

#2280 Medium

Maximum Total Importance of Roads

#2285 Medium

Partition Array Such That Maximum Difference Is K

#2294 Medium

Successful Pairs of Spells and Potions

#2300 Medium

Find Minimum Time to Finish All Jobs II

#2323 Medium

The Latest Time to Catch a Bus

#2332 Medium

Minimum Sum of Squared Difference

#2333 Medium

Minimum Amount of Time to Fill Cups

#2335 Easy

Max Sum of a Pair With Equal Sum of Digits

#2342 Medium

Query Kth Smallest Trimmed Number

#2343 Medium

Minimum Deletions to Make Array Divisible

#2344 Hard

Finding the Number of Visible Mountains

#2345 Medium

Make Array Zero by Subtracting Equal Amounts

#2357 Easy

Merge Similar Items

#2363 Easy

Minimize Maximum Value in a Grid

#2371 Hard

Find the K-Sum of an Array

#2386 Hard

Longest Subsequence With Limited Sum

#2389 Easy

Meeting Rooms III

#2402 Hard

Divide Intervals Into Minimum Number of Groups

#2406 Medium

Maximum Matching of Players With Trainers

#2410 Medium

Minimum Money Required Before Transactions

#2412 Hard

Sort the People

#2418 Easy

Number of Good Paths

#2421 Hard

Largest Positive Integer That Exists With Its Negative

#2441 Easy

Minimum Cost to Make Array Equal

#2448 Hard

Minimum Number of Operations to Make Arrays Similar

#2449 Hard

Most Popular Video Creator

#2456 Medium

Sort Array by Moving Items to Empty Space

#2459 Hard

Minimum Total Distance Traveled

#2463 Hard

Number of Distinct Averages

#2465 Easy

Number of Unequal Triplets in Array

#2475 Easy

Divide Players Into Teams of Equal Skill

#2491 Medium

Delete Greatest Value in Each Row

#2500 Easy

Longest Square Streak in an Array

#2501 Medium

Maximum Number of Points From Grid Queries

#2503 Hard

Reward Top K Students

#2512 Medium

Maximum Tastiness of Candy Basket

#2517 Medium

Maximum Subsequence Score

#2542 Medium

Sort the Students by Their Kth Score

#2545 Medium

Maximum Price to Fill a Bag

#2548 Medium

Put Marbles in Bags

#2551 Hard

Maximum Number of Integers to Choose From a Range I

#2554 Medium

Maximum Number of Integers to Choose From a Range II

#2557 Medium

Count the Number of Fair Pairs

#2563 Medium

Minimum Score by Changing Two Elements

#2567 Medium

Find the Maximum Number of Marked Indices

#2576 Medium

Split With Minimum Sum

#2578 Easy

Kth Largest Sum in a Binary Tree

#2583 Medium

Rearrange Array to Maximize Prefix Score

#2587 Medium

Design a Todo List

#2590 Medium

Maximize Greatness of an Array

#2592 Medium

The Number of Beautiful Subsets

#2597 Medium

Minimum Time to Eat All Grains

#2604 Hard

Beautiful Pairs

#2613 Hard

Count the Number of K-Free Subsets

#2638 Medium

Find Maximal Uncovered Ranges

#2655 Medium

Buy Two Chocolates

#2706 Easy

Neither Minimum nor Maximum

#2733 Easy

Find the Value of the Partition

#2740 Medium

Robot Collisions

#2751 Hard

Relocate Marbles

#2766 Medium

Maximum Beauty of an Array After Applying Operation

#2779 Medium

Minimum Index of a Valid Split

#2780 Medium

Check if Array is Good

#2784 Easy

Sort Vowels in a String

#2785 Medium

Apply Operations to Maximize Score

#2818 Hard

Minimum Relative Loss After Buying Chocolates

#2819 Hard

Count Pairs Whose Sum is Less than Target

#2824 Easy

Maximum Coins Heroes Can Collect

#2838 Medium

Check if Strings Can be Made Equal With Operations II

#2840 Medium

Happy Students

#2860 Medium

Maximum Length of Semi-Decreasing Subarrays

#2863 Medium

Minimum Processing Time

#2895 Medium

High-Access Employees

#2933 Medium

Make Lexicographically Smallest Array by Swapping Elements

#2948 Medium

Minimum Number of Coins to be Added

#2952 Medium

Divide Array Into Arrays With Max Difference

#2966 Medium

Find Polygon With the Largest Perimeter

#2971 Medium

Divide an Array Into Subarrays With Minimum Cost I

#3010 Easy

Find if Array Can Be Sorted

#3011 Medium

Minimum Number of Pushes to Type Word II

#3016 Medium

Type of Triangle

#3024 Easy

Find the Number of Ways to Place People I

#3025 Medium

Find the Number of Ways to Place People II

#3027 Hard

Maximum Palindromes After Operations

#3035 Medium

Apply Operations to Make String Empty

#3039 Medium

Find the Maximum Sum of Node Values

#3068 Hard

Apple Redistribution into Boxes

#3074 Easy

Maximize Happiness of Selected Children

#3075 Medium

Minimum Deletions to Make String K-Special

#3085 Medium

Make String Anti-palindrome

#3088 Hard

Maximum Number of Potholes That Can Be Fixed

#3119 Medium

Maximum Number That Makes Result of Bitwise AND Zero

#3125 Medium

Better Compression of String

#3167 Medium

Count Days Without Meetings

#3169 Medium

Minimum Moves to Get a Peaceful Board

#3189 Medium

Minimize Connected Groups by Inserting Interval

#3323 Medium

Zero Array Transformation III

#3362 Medium

Check if Grid can be Cut into Sections

#3394 Medium

Maximum Number of Distinct Elements After Operations

#3397 Medium

Sort Matrix by Diagonals

#3446 Medium

Maximum Sum With at Most K Elements

#3462 Medium

Maximize Profit from Task Assignment

#3476 Medium

Phone Number Prefix

#3491 Easy
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.