Skip to main content

LeetCode Problems by Official Solution Category

Suppose you're trying to learn how to use counting sort in the context of solving a programming challenge. A variety of strategies are possible, but solving a LeetCode problem is likely a good strategy for at least two reasons:

  1. The problem is supposed to be one seen before in interview settings (often making it more practical than theoretical).
  2. Accepted solutions must pass several test cases, sometimes hundreds or even over a thousand test cases.

But how can you effectively find problems on LeetCode where counting sort should be used? You could try consulting the sorting tag, where currently (Jan 15, 2025) there are well over 400 problems that bear the Sorting tag, but nothing is said about the specific sorting technique used (e.g., counting sort, bubble sort, cycle sort, merge sort, radix sort, etc.). On the other hand, there are some solution techniques (e.g., DFS and BFS on binary trees or general graphs) so general as to almost be useless to specify.

The lists of problems below are intended to make it easier to practice various problem-solving techniques. How? Each listed problem belongs to a specific solution category, where that solution category was used as an official solution to the linked problem on LeetCode's platform. For example, in the Cycle Sort category, problem LC 442. Find All Duplicates in an Array is listed — this means an official cycle sort solution is posted on LeetCode's platform for this problem (approach 4 as of writing).

How is this helpful? The goal is to highlight problem-solving techniques or algorithms that may not often appear in some official solutions (e.g., Floyd-Warshall, Hierholzer, Manacher, etc.) while also providing a number of practice problems for more established techniques (e.g., sliding window, two pointer, etc.). The lists below are by no means complete. LeetCode adds problem solutions and new approaches every single day. The point is that you can now view a large number of problems based on official solutions provided for those problems, hopefully allowing you to narrow what problems you practice based on what you are trying to learn.

The full category list is provided below for quick reference but also appears in the side menu:

A*

See A* search algorithm.

Backtracking

See backtracking.

Bellman-Ford

See Bellman-Ford algorithm.

BFS - Multisource

See multisource BFS.

See binary search (this includes binary search on normal arrays as well as solution spaces).

Binary search (recursive)

Binary tree (indexed, Fenwick Tree)

See Fenwick tree.

Binary tree (inorder, iterative)

Binary tree (inorder, recursive)

Binary tree (postorder, iterative)

Binary tree (postorder, recursive)

Binary tree (preorder, iterative)

Binary tree (preorder, recursive)

Bit manipulation

Bitmasking

Bitwise trie

Boolean array

Boyer-Moore

Brian Kernighan

BST

Bubble sort

Bucket sort

Caching

Canonical hash

Cantor diagonal

Cascading

Catalan numbers

Check all substrings

Circular queue

Connected components

Convex hull

Counting sort

Cycle sort

Day-Stout-Warren

Deque

Deterministic finite automaton

Difference array

Dijkstra

Divide and conquer

Doubly-linked list

Dynamic programming

Dynamic programming (2D)

Dynamic programming (3D)

Dynamic programming (iterative)

Dynamic programming (space optimized)

Dynamic programming (state machine)

Eulerian path

Eulerian tour

Factorial number system

Fisher-Yates

Floyd-Warshall

Follow the rules

GCD

Graham scan

Gray code

Greedy

Hadlock

Hashmap

Hashmap (one pass)

Hashmap (two pass)

Heap (priority queue)

Heapsort

Hierholzer

Horizontal scanning

Index as hash key

Insertion sort

Integer overflow

Interval stabbing

Inverse Burrows-Wheeler transform

Jarvis

JavaScript

Kadane

Karnaugh map

KMP (Knuth-Morris-Pratt)

Line sweep

Linear algebra

Linear transformation

Manacher

Manhattan distance

Math

Matrix

Matrix chain multiplication

Matrix (Yale)

Meet in the middle

Merge sort

Minimax

Monotone chain

Monotonic deque

Monotonic stack

Morris traversal

MST (Kruskal)

MST (Prim)

Multiset

Ordered map

Ordered set

Palindrome

Pandas

Pigeonhole principle

Prefix product

Prefix sum

Prefix sum (hashing)

Prefix sum (space optimized)

Queue

Quickselect

Quicksort

Rabin-Karp (single hash)

Rabin-Karp (double hash)

Rabin-Karp (rolling hash)

Radix sort

Recursion

Regex

Rejection sampling

Reservoir sampling

Rolling hash

Segment tree

Sieve of Eratosthenes

Simulation

Sliding window

Sliding window (optimized)

Sorting

Shortest path first algorithm (SPFA)

Stack

Suffix array

Suffix product

Suffix sum

Tarjan

Three pointers

Timsort

Topological sort

Topological sort (longest path)

Tree hash

Tree map

Tree (n-ary)

Trie

Two pointer

Union-find

Vertical scanning

Warnsdorff rule

Wormhole teleportation