LeetCodechevron_rightCategorieschevron_rightsorting
sort

sorting

400 problems
Easy: 81Medium: 233Hard: 86

sorting is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

Problem bank

sorting problem bank

Start with a compact scan-friendly list and progressively load more so the topic page stays readable even when the corpus is large.

Progressive topic library

Built for large topic sets: scan the structure first, then go deeper.

hourglass_bottomScroll to continue
search
tuneDifficulty

Showing 24 / 400 problems

+24 per load
#TitleDifficulty
15

3Sum

Given an integer array, return all unique triplets where the sum is zero using two-pointer scanning with careful duplica…

Medium
16

3Sum Closest

Find the sum of three integers in an array that is closest to a given target using two-pointer scanning.

Medium
18

4Sum

The 4Sum problem requires finding all unique quadruplets in an array that sum to a specific target value.

Medium
47

Permutations II

Generate all unique permutations of an array containing duplicates using backtracking and pruning to avoid repeated sequ…

Medium
49

Group Anagrams

Group the anagrams in a list of strings using efficient hash table-based methods, focusing on array scanning.

Medium
56

Merge Intervals

Merge Intervals requires sorting an array of interval pairs and combining overlaps efficiently using sequential comparis…

Medium
75

Sort Colors

Sort Colors requires in-place reordering of an array using a two-pointer scanning strategy to group 0s, 1s, and 2s effic…

Medium
88

Merge Sorted Array

Merge two sorted arrays into the first array in non-decreasing order, using a two-pointer approach.

Easy
147

Insertion Sort List

Sort a singly linked list using insertion sort by carefully manipulating pointers to maintain a sorted order efficiently…

Medium
148

Sort List

Sort List requires sorting a singly linked list efficiently using pointer manipulation and merge sort for optimal perfor…

Medium
164

Maximum Gap

Find the largest difference between successive elements in a sorted array efficiently using linear time techniques and b…

Medium
169

Majority Element

Find the majority element in an array, where the element appears more than n/2 times, using efficient algorithms.

Easy
179

Largest Number

The problem asks to arrange integers to form the largest possible number, focusing on greedy algorithms and string handl…

Medium
215

Kth Largest Element in an Array

Find the kth largest element in an unsorted array using optimal approaches like Quickselect or heaps.

Medium
217

Contains Duplicate

Determine if an integer array contains any duplicate values by efficiently scanning with a hash lookup to ensure fast de…

Easy
220

Contains Duplicate III

The problem involves finding a pair of indices in an array where the index and value differences are within given limits…

Hard
229

Majority Element II

Identify all elements in an integer array appearing more than ⌊ n/3 ⌋ times using efficient array scanning and hash coun…

Medium
242

Valid Anagram

Check if two strings are anagrams using hashing or sorting techniques.

Easy
268

Missing Number

Find the missing number in an array containing distinct numbers in the range [0, n].

Easy
274

H-Index

Determine a researcher's h-index by analyzing citations using array sorting and counting techniques efficiently and accu…

Medium
295

Find Median from Data Stream

Implement a MedianFinder class that supports adding numbers and finding the median from a data stream.

Hard
324

Wiggle Sort II

Rearrange an array in a way that every odd-indexed element is greater than its adjacent even-indexed elements.

Medium
347

Top K Frequent Elements

Find the k most frequent elements from an array using efficient algorithms like hashing and sorting.

Medium
349

Intersection of Two Arrays

Find the intersection of two arrays while ensuring unique elements using efficient array scanning and hash lookups.

Easy

swap_vertScroll inside the bank to auto-load more

Related Patterns

Sorting LeetCode Problems: 400 Solutions