Leetcode problem list

TopSWE 100

Solve these 100 carefully curated problems in order. See you at the top!

Image Description
Asked at MAANG
and other top 50 tech companies
CheckboxNumberIDTitleTags
1412easyfizz buzz
math
string
simulation
21easytwo sum
array
hash table
3242easyvalid anagram
string
sorting
hash table
4344easyreverse string
string
two pointers
5125easyvalid palindrome
string
two pointers
614easylongest common prefix
trie
string
7326easypower of three
math
recursion
8191easynumber of 1 bits
bit manipulation
divide and conquer
9303easyrange sum query - immutable
array
design
prefix sum
101013easyfibonacci number
math
recursion
memoization
+1
1170easyclimbing stairs
math
memoization
dynamic programming
12747easymin cost climbing stairs
array
dynamic programming
13121easybest time to buy and sell stock
array
dynamic programming
1494easybinary tree inorder traversal
tree
stack
binary tree
+1
15226easyinvert binary tree
tree
binary tree
depth first search
+1
16101easysymmetric tree
tree
binary tree
depth first search
+1
17104easymaximum depth of binary tree
tree
binary tree
depth first search
+1
18100easysame tree
tree
binary tree
depth first search
+1
19112easypath sum
tree
binary tree
depth first search
+1
20111easyminimum depth of binary tree
tree
binary tree
depth first search
+1
2198mediumvalidate binary search tree
tree
binary tree
depth first search
+1
22206easyreverse linked list
recursion
linked list
23908easymiddle of the linked list
linked list
two pointers
24102mediumbinary tree level order traversal
tree
binary tree
breadth first search
252121easyfind if path exists in graph
graph
union find
depth first search
+1
26200mediumnumber of islands
array
matrix
union find
+2
27695mediummax area of island
array
matrix
union find
+2
282035mediumcount sub islands
array
matrix
union find
+2
2920easyvalid parentheses
stack
string
30238mediumproduct of array except self
array
prefix sum
31792easybinary search
array
binary search
32957mediumminimum add to make parentheses valid
stack
string
greedy
335mediumlongest palindromic substring
string
dynamic programming
34167mediumtwo sum ii - input array is sorted
array
two pointers
binary search
3511mediumcontainer with most water
array
greedy
two pointers
3615medium3sum
array
sorting
two pointers
3749mediumgroup anagrams
array
string
sorting
+1
38215mediumkth largest element in an array
array
sorting
quickselect
+2
391014mediumk closest points to origin
math
array
sorting
+4
40380mediuminsert delete getrandom o(1)
math
array
design
+2
41278easyfirst bad version
interactive
binary search
42162mediumfind peak element
array
binary search
4369easysqrt(x)
math
binary search
44907mediumkoko eating bananas
array
binary search
45560mediumsubarray sum equals k
array
hash table
prefix sum
46523mediumcontinuous subarray sum
math
array
hash table
+1
471370mediumcount number of nice subarrays
math
array
hash table
+1
48133mediumclone graph
graph
hash table
depth first search
+1
49138mediumcopy list with random pointer
hash table
linked list
50801mediumis graph bipartite?
graph
union find
depth first search
+1
51399mediumevaluate division
array
graph
union find
+3
5253mediummaximum subarray
array
divide and conquer
dynamic programming
53152mediummaximum product subarray
array
dynamic programming
5462mediumunique paths
math
combinatorics
dynamic programming
5564mediumminimum path sum
array
matrix
dynamic programming
563mediumlongest substring without repeating characters
string
hash table
sliding window
571046mediummax consecutive ones iii
array
prefix sum
binary search
+1
582134mediummaximize the confusion of an exam
string
prefix sum
binary search
+1
592478mediumlongest nice subarray
array
sliding window
bit manipulation
60912mediumrandom pick with weight
math
array
prefix sum
+2
61139mediumword break
trie
array
string
+3
62198mediumhouse robber
array
dynamic programming
63322mediumcoin change
array
dynamic programming
breadth first search
64300mediumlongest increasing subsequence
array
binary search
dynamic programming
651250mediumlongest common subsequence
string
dynamic programming
66235mediumlowest common ancestor of a binary search tree
tree
binary tree
depth first search
+1
67124hardbinary tree maximum path sum
tree
binary tree
depth first search
+1
68122mediumbest time to buy and sell stock ii
array
greedy
dynamic programming
6955mediumjump game
array
greedy
dynamic programming
70210mediumcourse schedule ii
graph
topological sort
depth first search
+1
711325mediumpath with maximum probability
array
graph
shortest path
+1
721753mediumpath with minimum effort
array
matrix
union find
+4
7356mediummerge intervals
array
sorting
7457mediuminsert interval
array
751028mediuminterval list intersections
array
two pointers
76146mediumlru cache
design
hash table
linked list
+1
77173mediumbinary search tree iterator
tree
stack
design
+3
78155mediummin stack
stack
design
79225easyimplement stack using queues
stack
queue
design
8017mediumletter combinations of a phone number
string
hash table
backtracking
8139mediumcombination sum
array
backtracking
8246mediumpermutations
array
backtracking
8378mediumsubsets
array
backtracking
bit manipulation
84131mediumpalindrome partitioning
string
backtracking
dynamic programming
85208mediumimplement trie (prefix tree)
trie
string
design
+1
86224hardbasic calculator
math
stack
string
+1
87739mediumdaily temperatures
array
stack
monotonic stack
88937mediumonline stock span
stack
design
data stream
+1
89416mediumpartition equal subset sum
array
dynamic programming
90684mediumredundant connection
graph
union find
depth first search
+1
91295hardfind median from data stream
design
sorting
data stream
+2
9242hardtrapping rain water
array
stack
two pointers
+2
93149hardmax points on a line
math
array
geometry
+1
94297hardserialize and deserialize binary tree
tree
string
design
+3
951352hardmaximum profit in job scheduling
array
sorting
binary search
+1
96239hardsliding window maximum
array
queue
sliding window
+2
9772mediumedit distance
string
dynamic programming
9884hardlargest rectangle in histogram
array
stack
monotonic stack
99726hardnumber of atoms
stack
string
sorting
+1
100460hardlfu cache
design
hash table
linked list
+1
Congratulations!