| 0001 |
Two Sum |
hash-map |
|
| 0002 |
Add Two Numbers |
linked-list, dummy-list-head |
|
| 0003 |
Longest Substring Without Repeating Characters |
sliding-window |
|
| 0005 |
Longest Palindromic Substring |
palindrome |
|
| 0006 |
Zigzag Conversion |
simulation, math |
|
| 0009 |
Palindrome Number |
palindrome, math |
|
| 0011 |
Container With Most Water |
two-pointers |
|
| 0013 |
Roman to Integer |
string |
|
| 0015 |
3Sum |
k-sum |
|
| 0019 |
Remove Nth Node From End of List |
linked-list, two-pointers, trailing-pointer |
|
| 0020 |
Valid Parentheses |
stack, parentheses |
|
| 0021 |
Merge Two Sorted Lists |
linked-list |
|
| 0026 |
Remove Duplicates from Sorted Array |
array-shift, two-pointers |
|
| 0027 |
Remove Element |
two-pointers |
|
| 0033 |
Search in Rotated Sorted Array |
binary-search |
|
| 0034 |
Find First and Last Position of Element in Sorted Array |
binary-search |
|
| 0035 |
Search Insert Position |
binary-search |
|
| 0039 |
Combination Sum |
backtracking |
|
| 0042 |
Trapping Rain Water |
pointers, reverse-thinking |
|
| 0048 |
Rotate Image |
matrix, math |
|
| 0049 |
Group Anagrams |
hash-map, anagram |
|
| 0053 |
Maximum Subarray |
subset-sum, dp |
|
| 0054 |
Spiral Matrix |
matrix |
|
| 0055 |
Jump Game |
dp, greedy |
|
| 0056 |
Merge Intervals |
interval-merge |
|
| 0057 |
Insert Interval |
interval-merge |
|
| 0061 |
Rotate List |
linked-list, list-to-ring |
|
| 0062 |
Unique Paths |
dp-2d |
|
| 0064 |
Minimum Path Sum |
dp-2d, dp |
|
| 0068 |
Text Justification |
string, simulation |
|
| 0070 |
Climbing Stairs |
dp |
|
| 0071 |
Simplify Path |
stack |
|
| 0073 |
Set Matrix Zeroes |
matrix |
|
| 0074 |
Search a 2D Matrix |
binary-search |
|
| 0079 |
Word Search |
backtracking-with-matrix |
|
| 0088 |
Merge Sorted Array |
pointers |
|
| 0091 |
Decode Ways |
dp, backtracking |
|
| 0093 |
Restore IP Addresses |
backtracking |
|
| 0094 |
Binary Tree Inorder Traversal |
binary-tree-traversal-inorder |
|
| 0098 |
Validate Binary Search Tree |
bst, recursion |
|
| 0100 |
Same Tree |
binary-tree-traversal, recursion |
|
| 0101 |
Symmetric Tree |
binary-tree-traversal |
|
| 0102 |
Binary Tree Level Order Traversal |
binary-tree-traversal-level-order, bfs-layered, recursion |
|
| 0104 |
Maximum Depth of Binary Tree |
binary-tree-traversal |
|
| 0105 |
Construct Binary Tree from Preorder and Inorder Traversal |
binary-tree-traversal-inorder, binary-tree-traversal-preorder |
|
| 0106 |
Construct Binary Tree from Inorder and Postorder Traversal |
binary-tree-manipulation |
|
| 0108 |
Convert Sorted Array to Binary Search Tree |
bst |
|
| 0110 |
Balanced Binary Tree |
binary-tree, recursion |
|
| 0111 |
Minimum Depth of Binary Tree |
bfs, binary-tree |
|
| 0112 |
Path Sum |
binary-tree, recursion |
|
| 0121 |
Best Time to Buy and Sell Stock |
dp-stock |
|
| 0122 |
Best Time to Buy and Sell Stock II |
dp-stock, greedy |
|
| 0123 |
Best Time to Buy and Sell Stock III |
dp-stock, state-machine |
|
| 0124 |
Binary Tree Maximum Path Sum |
recursion, binary-tree |
|
| 0125 |
Valid Palindrome |
palindrome |
|
| 0127 |
Word Ladder |
bfs |
|
| 0128 |
Longest Consecutive Sequence |
set |
|
| 0129 |
Sum Root to Leaf Numbers |
recursion, binary-tree |
|
| 0133 |
Clone Graph |
dfs, bfs |
|
| 0136 |
Single Number |
math |
|
| 0138 |
Copy List with Random Pointer |
linked-list, dummy-list-head, recursion |
|
| 0139 |
Word Break |
dfs, dp |
|
| 0141 |
Linked List Cycle |
linked-list, fast-slow-pointer |
|
| 0143 |
Reorder List |
linked-list |
|
| 0144 |
Binary Tree Preorder Traversal |
binary-tree-traversal-preorder |
|
| 0145 |
Binary Tree Postorder Traversal |
binary-tree-traversal-postorder |
|
| 0146 |
LRU Cache |
lru-cache |
|
| 0150 |
Evaluate Reverse Polish Notation |
stack |
|
| 0152 |
Maximum Product Subarray |
dp, greedy, prefix-sum-subarray |
|
| 0153 |
Find Minimum in Rotated Sorted Array |
binary-search |
|
| 0160 |
Intersection of Two Linked Lists |
linked-list |
|
| 0167 |
Two Sum II - Input Array Is Sorted |
k-sum |
|
| 0169 |
Majority Element |
counting, boyer-moore-voting-algorithm |
|
| 0173 |
Binary Search Tree Iterator |
bst, iterator |
|
| 0188 |
Best Time to Buy and Sell Stock IV |
dp-stock, state-machine |
|
| 0190 |
Reverse Bits |
bits |
|
| 0191 |
Number of 1 Bits |
bits |
|
| 0198 |
House Robber |
dp |
|
| 0200 |
Number of Islands |
dfs-bfs-grid |
|
| 0202 |
Happy Number |
set, fast-slow-pointer |
|
| 0206 |
Reverse Linked List |
linked-list |
|
| 0207 |
Course Schedule |
topological-sorting, bfs-layered |
|
| 0208 |
Implement Trie (Prefix Tree) |
trie-prefix-tree |
|
| 0211 |
Design Add and Search Words Data Structure |
trie-prefix-tree, dfs, recursion |
|
| 0212 |
Word Search II |
backtracking-with-matrix, trie-prefix-tree |
|
| 0213 |
House Robber II |
dp |
|
| 0215 |
Kth Largest Element in an Array |
k-most-points, priority-queue, bubble-sort, quick-sort, counting-sort |
|
| 0217 |
Contains Duplicate |
set |
|
| 0221 |
Maximal Square |
dp-2d |
|
| 0222 |
Count Complete Tree Nodes |
binary-tree |
|
| 0223 |
Rectangle Area |
math |
|
| 0224 |
Basic Calculator |
calculator, parentheses |
|
| 0226 |
Invert Binary Tree |
binary-tree-manipulation |
|
| 0227 |
Basic Calculator II |
calculator |
|
| 0228 |
Summary Ranges |
trailing-pointer |
|
| 0232 |
Implement Queue using Stacks |
stack, queue |
|
| 0234 |
Palindrome Linked List |
palindrome-center-expansion, fast-slow-pointer |
|
| 0235 |
Lowest Common Ancestor of a Binary Search Tree |
least-common-ancestor, bst |
|
| 0236 |
Lowest Common Ancestor of a Binary Tree |
least-common-ancestor |
|
| 0238 |
Product of Array Except Self |
math, subset-sum |
|
| 0242 |
Valid Anagram |
string |
|
| 0263 |
Ugly Number |
math |
|
| 0268 |
Missing Number |
math |
|
| 0273 |
Integer to English Words |
string, recursion |
|
| 0278 |
First Bad Version |
binary-search |
|
| 0283 |
Move Zeroes |
array-shift, two-pointers |
|
| 0289 |
Game of Life |
simulation, state-changes |
|
| 0297 |
Serialize and Deserialize Binary Tree |
binary-tree |
|
| 0309 |
Best Time to Buy and Sell Stock with Cooldown |
state-machine |
|
| 0322 |
Coin Change |
knapsack-unbounded, dp-2d |
|
| 0328 |
Odd Even Linked List |
two-pointers |
|
| 0334 |
Increasing Triplet Subsequence |
array |
|
| 0338 |
Counting Bits |
bits, dp |
|
| 0341 |
Flatten Nested List Iterator |
iterator |
|
| 0344 |
Reverse String |
string |
|
| 0345 |
Reverse Vowels of a String |
two-pointers, string |
|
| 0347 |
Top K Frequent Elements |
k-most-points, bucket-sort, hash-map |
|
| 0374 |
Guess Number Higher or Lower |
binary-search |
|
| 0380 |
Insert Delete GetRandom O(1) |
hash-map, array |
|
| 0385 |
Mini Parser |
recursion, serialization |
|
| 0406 |
Queue Reconstruction by Height |
sort |
|
| 0413 |
Arithmetic Slices |
dp |
|
| 0415 |
Add Strings |
string |
|
| 0416 |
Partition Equal Subset Sum |
knapsack-1-0 |
|
| 0417 |
Pacific Atlantic Water Flow |
bfs-grid, reverse-thinking |
|
| 0424 |
Longest Repeating Character Replacement |
sliding-window |
|
| 0435 |
Non-overlapping Intervals |
interval-merge, greedy |
|
| 0451 |
Sort Characters By Frequency |
counting |
|
| 0452 |
Minimum Number of Arrows to Burst Balloons |
interval-merge |
|
| 0460 |
LFU Cache |
lfu-cache |
|
| 0462 |
Minimum Moves to Equal Array Elements II |
math |
|
| 0494 |
Target Sum |
backtracking, dp, knapsack-1-0 |
|
| 0495 |
Teemo Attacking |
greedy, interval-merge, simulation |
|
| 0501 |
Find Mode in Binary Search Tree |
bst, binary-tree-traversal-inorder, dfs |
|
| 0509 |
Fibonacci Number |
recursion |
|
| 0543 |
Diameter of Binary Tree |
binary-tree-traversal |
|
| 0572 |
Subtree of Another Tree |
tree-serialization, binary-tree |
|
| 0605 |
Can Place Flowers |
array |
|
| 0606 |
Construct String from Binary Tree |
recursion, binary-tree |
|
| 0621 |
Task Scheduler |
greedy, math |
|
| 0623 |
Add One Row to Tree |
binary-tree-manipulation, dfs |
|
| 0647 |
Palindromic Substrings |
palindrome, string |
|
| 0653 |
Two Sum IV - Input is a BST |
k-sum, dfs |
|
| 0665 |
Non-decreasing Array |
monotonic-stack |
|
| 0682 |
Baseball Game |
simulation |
|
| 0695 |
Max Area of Island |
dfs-bfs-grid |
|
| 0698 |
Partition to K Equal Sum Subsets |
subset-sum, backtracking |
|
| 0700 |
Search in a Binary Search Tree |
bst |
|
| 0704 |
Binary Search |
binary-search |
|
| 0713 |
Subarray Product Less Than K |
sliding-window |
|
| 0740 |
Delete and Earn |
dp |
|
| 0746 |
Min Cost Climbing Stairs |
dp |
|
| 0752 |
Open the Lock |
bfs |
|
| 0771 |
Jewels and Stones |
set |
|
| 0773 |
Sliding Puzzle |
bfs |
|
| 0799 |
Champagne Tower |
simulation |
|
| 0827 |
Making A Large Island |
dfs-bfs-grid |
|
| 0872 |
Leaf-Similar Trees |
binary-tree-traversal |
|
| 0876 |
Middle of the Linked List |
fast-slow-pointer |
|
| 0881 |
Boats to Save People |
two-pointers, greedy |
|
| 0897 |
Increasing Order Search Tree |
bst |
|
| 0901 |
Online Stock Span |
monotonic-stack |
|
| 0931 |
Minimum Falling Path Sum |
dp-2d |
|
| 0938 |
Range Sum of BST |
bst, recursion |
|
| 0946 |
Validate Stack Sequences |
stack, simulation, greedy |
|
| 0953 |
Verifying an Alien Dictionary |
hash-map, topological-sorting |
|
| 0958 |
Check Completeness of a Binary Tree |
binary-tree, bfs |
|
| 0983 |
Minimum Cost For Tickets |
dp, knapsack-unbounded |
|
| 0991 |
Broken Calculator |
reverse-thinking, puzzle |
|
| 1020 |
Number of Enclaves |
dfs-bfs-grid |
|
| 1041 |
Robot Bounded In Circle |
math, simulation |
|
| 1046 |
Last Stone Weight |
priority-queue |
|
| 1091 |
Shortest Path in Binary Matrix |
bfs-for-shortest-path, priority-queue |
|
| 1094 |
Car Pooling |
interval-overlap |
|
| 1143 |
Longest Common Subsequence |
dp-2d |
|
| 1162 |
As Far from Land as Possible |
bfs-layered, bfs-grid |
|
| 1207 |
Unique Number of Occurrences |
counting |
|
| 1235 |
Maximum Profit in Job Scheduling |
dp, priority-queue |
|
| 1249 |
Minimum Remove to Make Valid Parentheses |
stack, parentheses |
|
| 1254 |
Number of Closed Islands |
dfs-bfs-grid |
|
| 1339 |
Maximum Product of Splitted Binary Tree |
binary-tree |
|
| 1387 |
Sort Integers by The Power Value |
cache |
|
| 1423 |
Maximum Points You Can Obtain from Cards |
sliding-window, array |
|
| 1431 |
Kids With the Greatest Number of Candies |
simulation |
|
| 1466 |
Reorder Routes to Make All Paths Lead to the City Zero |
dfs, bfs |
|
| 1470 |
Shuffle the Array |
array |
|
| 1472 |
Design Browser History |
stack |
|
| 1544 |
Make The String Great |
stack |
|
| 1557 |
Minimum Number of Vertices to Reach All Nodes |
topological-sorting |
|
| 1578 |
Minimum Time to Make Rope Colorful |
pointers, array |
|
| 1647 |
Minimum Deletions to Make Character Frequencies Unique |
hash-map-count |
|
| 1657 |
Determine if Two Strings Are Close |
counting |
|
| 1662 |
Check If Two String Arrays are Equivalent |
string |
|
| 1673 |
Find the Most Competitive Subsequence |
monotonic-stack |
|
| 1704 |
Determine if String Halves Are Alike |
string |
|
| 1710 |
Maximum Units on a Truck |
greedy |
|
| 1757 |
Recyclable and Low Fat Products |
sql |
|
| 1768 |
Merge Strings Alternately |
pointers |
|
| 2043 |
Simple Bank System |
simulation |
|
| 2095 |
Delete the Middle Node of a Linked List |
fast-slow-pointer |
|
| 2131 |
Longest Palindrome by Concatenating Two Letter Words |
palindrome, string |
|
| 2182 |
Construct String With Repeat Limit |
priority-queue |
|
| 2283 |
Check if Number Has Equal Digit Count and Digit Value |
hash-map-count |
|
| 2284 |
Sender With Largest Word Count |
hash-map-count |
|
| 2287 |
Rearrange Characters to Make Target String |
hash-map-count |
|
| 2293 |
Min Max Game |
recursion, simulation |
|
| 2294 |
Partition Array Such That Maximum Difference Is K |
array |
|
| 2326 |
Spiral Matrix IV |
spiral-matrix |
|
| 2348 |
Number of Zero-Filled Subarrays |
array, math |
|
| 2389 |
Longest Subsequence With Limited Sum |
subset-sum, binary-search |
|
| 2390 |
Removing Stars From a String |
stack |
|
| 2404 |
Most Frequent Even Element |
hash-map-count |
|
| 2405 |
Optimal Partition of String |
string, greedy |
|
| 2413 |
Smallest Even Multiple |
math |
|
| 2414 |
Length of the Longest Alphabetical Continuous Substring |
pointers, stack |
|
| 2418 |
Sort the People |
hash-map |
|
| 2423 |
Remove Letter To Equalize Frequency |
hash-map-count |
|
| 2427 |
Number of Common Factors |
math |
|
| 2432 |
The Employee That Worked on the Longest Task |
array |
|
| 2433 |
Find The Original Array of Prefix Xor |
math |
|
| 2437 |
Number of Valid Clock Times |
simulation |
|
| 2441 |
Largest Positive Integer That Exists With Its Negative |
two-pointers |
|
| 2446 |
Determine if Two Events Have Conflict |
interval |
|
| 2451 |
Odd String Difference |
array, counting |
|
| 2455 |
Average Value of Even Numbers That Are Divisible by Three |
math |
|
| 2456 |
Most Popular Video Creator |
hash-map-count |
|
| 2492 |
Minimum Score of a Path Between Two Cities |
dfs, bfs, union-find |
|
| 2924 |
Find Champion II |
graph |
|
| 3043 |
Find the Length of the Longest Common Prefix |
trie-prefix-tree |
|
| 3110 |
Score of a String |
string |
|
| 3264 |
Final Array State After K Multiplication Operations I |
priority-queue |
|
| 3394 |
Check if Grid can be Cut into Sections |
interval-merge |
|
| 2460 |
Apply Operations to an Array |
two-pointers |
|