0001 |
Two Sum |
Solution |
Easy |
Hash Table, Array |
0002 |
Add Two Numbers |
Solution |
Medium |
Linked List, Math, Recursion |
0003 |
Longest Substring Without Repeating Characters |
Solution |
Medium |
Hash Table, String, Sliding Window |
0005 |
Longest Palindromic Substring |
Solution |
Medium |
String, Dynamic Programming |
0007 |
Reverse Integer |
Solution |
Easy |
Math |
0009 |
Palindrome Number |
Solution |
Easy |
Math |
0011 |
Container With Most Water |
Solution |
Medium |
Array, Two Pointers, Greedy |
0013 |
Roman to Integer |
Solution |
Easy |
Hash Table, Math, String |
0014 |
Longest Common Prefix |
Solution |
Easy |
String |
0015 |
3Sum |
Solution |
Medium |
Array, Two Pointers, Sorting |
0016 |
3Sum Closest |
Solution |
Medium |
Array, Two Pointers, Sorting |
0017 |
Letter Combinations of a Phone Number |
Solution |
Medium |
Hash Table, String, Backtracking |
0018 |
4Sum |
Solution |
Medium |
Array, Two Pointers, Sorting |
0019 |
Remove Nth Node From End of List |
Solution |
Medium |
Linked List, Two Pointers |
0020 |
Valid Parentheses |
Solution |
Easy |
String, Stack |
0021 |
Merge Two Sorted Lists |
Solution |
Easy |
Linked List, Recursion |
0024 |
Swap Nodes in Pairs |
Solution |
Medium |
Linked List |
0025 |
Reverse Nodes in k-Group |
Solution |
Hard |
Linked List |
0026 |
Remove Duplicates from Sorted Array |
Solution |
Easy |
Array, Two Pointers |
0027 |
Remove Element |
Solution |
Easy |
Array, Two Pointers |
0028 |
Implement strStr() |
Solution |
Easy |
Two Pointers, String, String Matching |
0031 |
Next Permutation |
Solution |
Medium |
Array, Two Pointers |
0033 |
Search in Rotated Sorted Array |
Solution |
Medium |
Binary Search, Array |
0034 |
Find First and Last Position of Element in Sorted Array |
Solution |
Medium |
Binary Search, Array |
0035 |
Search Insert Position |
Solution |
Easy |
Binary Search, Array |
0046 |
Permutations |
Solution |
Medium |
Array, Backtracking |
0048 |
Rotate Image |
Solution |
Medium |
Array, Math, Matrix |
0051 |
N-Queens |
Solution |
Hard |
Array, Backtracking |
0052 |
N-Queens II |
Solution |
Hard |
Array, Backtracking |
0054 |
Spiral Matrix |
Solution |
Medium |
Array, Matrix, Simulation |
0055 |
Jump Game |
Solution |
Medium |
Array, Greedy |
0059 |
Spiral Matrix II |
Solution |
Medium |
Array, Matrix, Simulation |
0058 |
Length of Last Word |
Solution |
Easy |
String |
0061 |
Rotate List |
Solution |
Medium |
LinkedList, Two Pointers |
0062 |
Unique Paths |
Solution |
Medium |
Math, Dynamic Programming |
0066 |
Plus One |
Solution |
Easy |
Array |
0067 |
Add Binary |
Solution |
Easy |
Bit Manipulation, String |
0069 |
Sqrt(x) |
Solution |
Easy |
Binary Search, Math |
0070 |
Climbing Stairs |
Solution |
Easy |
Math, Dynamic Programming, Memoization |
0074 |
Search a 2D Matrix |
Solution |
Medium |
Binary Search, Matrix |
0075 |
Sort Colors |
Solution |
Medium |
Two Pointers, Array |
0078 |
Subsets |
Solution |
Medium |
Array, Backtracking |
0080 |
Remove Duplicates from Sorted Array II |
Solution |
Medium |
Two Pointers, Array |
0081 |
Search in Rotated Sorted Array II |
Solution |
Medium |
Binary Search, Array |
0086 |
Partition List |
Solution |
Medium |
Linked List, Two Pointers |
0088 |
Merge Sorted Array |
Solution |
Easy |
Two Pointers, Array |
0090 |
Subsets II |
Solution |
Medium |
Array, Backtracking |
0091 |
Decode Ways |
Solution |
Medium |
String, Dynamic Programming |
0092 |
Reverse Linked List II |
Solution |
Medium |
Linked List |
0094 |
Binary Tree Inorder Traversal |
Solution |
Easy |
Stack, Tree, Depth-First Search, Binary Tree |
0097 |
Interleaving String |
Solution |
Medium |
String, Dynamic Programming |
0098 |
Validate Binary Search Tree |
Solution |
Medium |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
0100 |
Same Tree |
Solution |
Easy |
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
0102 |
Binary Tree Level Order Traversal |
Solution |
Easy |
Tree, Breadth-First Search, Binary Tree |
0103 |
Binary Tree Zigzag Level Order Traversal |
Solution |
Medium |
Tree, Breadth-First Search, Binary Tree |
0104 |
Maximum Depth of Binary Tree |
Solution |
Easy |
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
0105 |
Construct Binary Tree from Preorder and Inorder Traversal |
Solution |
Medium |
Array, Hash Table, Divide and Conquer, Tree, Binary Tree |
0106 |
Construct Binary Tree from Inorder and Postorder Traversal |
Solution |
Medium |
Array, Hash Table, Divide and Conquer, Tree, Binary Tree |
0107 |
Binary Tree Level Order Traversal II |
Solution |
Medium |
Tree, Breadth-First Search, Binary Tree |
0110 |
Balanced Binary Tree |
Solution |
Easy |
Tree, Depth-First Search, Binary Tree |
0111 |
Minimum Depth of Binary Tree |
Solution |
Easy |
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
0112 |
Path Sum |
Solution |
Easy |
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
0113 |
Path Sum II |
Solution |
Medium |
Backtracking, Tree, Depth-First Search, Binary Tree |
0116 |
Populating Next Right Pointers in Each Node |
Solution |
Medium |
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
0117 |
Populating Next Right Pointers in Each Node II |
Solution |
Medium |
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
0118 |
Pascal's Triangle |
Solution |
Easy |
Array |
0118 |
Pascal's Triangle II |
Solution |
Easy |
Array |
0124 |
Binary Tree Maximum Path Sum |
Solution |
Hard |
Dynamic Programming, Tree, Depth-First Search, Binary Tree |
0125 |
Valid Palindrome |
Solution |
Easy |
Two Pointers, String |
0128 |
Longest Consecutive Sequence |
Solution |
Medium |
Array, Hash Table |
0135 |
Candy |
Solution |
Hard |
Array, Greedy |
0136 |
Single Number |
Solution |
Easy |
Bit Manipulation |
0137 |
Single Number II |
Solution |
Medium |
Bit Manipulation |
0141 |
Linked List Cycle |
Solution |
Easy |
Hash Table, Linked List, Two Pointers |
0142 |
Linked List Cycle II |
Solution |
Medium |
Hash Table, Linked List, Two Pointers |
0144 |
Binary Tree Preorder Traversal |
Solution |
Easy |
Stack, Tree, Depth-First Search, Binary Tree |
0145 |
Binary Tree Postorder Traversal |
Solution |
Easy |
Stack, Tree, Depth-First Search, Binary Tree |
0151 |
Reverse Words in a String |
Solution |
Medium |
String |
0153 |
Find Minimum in Rotated Sorted Array |
Solution |
Medium |
Binary Search, Array |
0160 |
Intersection of Two Linked Lists |
Solution |
Easy |
Hash Table, Linked List, Two Pointers |
0162 |
Find Peak Element |
Solution |
Medium |
Binary Search, Array |
0167 |
Two Sum II - Input array is sorted |
Solution |
Easy |
Two Pointers, Array |
0171 |
Excel Sheet Column Number |
Solution |
Easy |
Math |
0173 |
Binary Search Tree Iterator |
Solution |
Medium |
Stack, Tree, Design, Binary Search Tree, Binary Tree, Iterator |
0189 |
Rotate Array |
Solution |
Medium |
Array, Math, Two Pointers |
0191 |
Number of 1 Bits |
Solution |
Easy |
Bit Manipulation |
0199 |
Binary Tree Right Side View |
Solution |
Medium |
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
0203 |
Remove Linked List Elements |
Solution |
Easy |
Linked List |
0205 |
Isomorphic Strings |
Solution |
Easy |
String, Hash Table |
0206 |
Reverse Linked List |
Solution |
Easy |
Linked List, Recursion |
0215 |
Kth Largest Element in an Array |
Solution |
Medium |
Array, Heap(Priority Queue) |
0217 |
Contains Duplicate |
Solution |
Easy |
Array, Hash Table, Sorting |
0219 |
Contains Duplicate II |
Solution |
Easy |
Array, Hash Table, Sliding Window |
0225 |
Implement Stack using Queues |
Solution |
Easy |
Stack, Design, Queue |
0226 |
Invert Binary Tree |
Solution |
Easy |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
0230 |
Kth Smallest Element in a BST |
Solution |
Medium |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
0231 |
Power of Two |
Solution |
Easy |
Math, Bit Manipulation, Recursion |
0234 |
Palindrome Linked List |
Solution |
Easy |
Linked List, Two Pointers |
0235 |
Lowest Common Ancestor of a Binary Search Tree |
Solution |
Easy |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
0236 |
Lowest Common Ancestor of a Binary Tree |
Solution |
Medium |
Tree, Depth-First Search, Binary Tree |
0237 |
Delete Node in a Linked List |
Solution |
Easy |
Linked List |
0240 |
Search a 2D Matrix II |
Solution |
Medium |
Binary Search, Matrix |
0242 |
Valid Anagram |
Solution |
Easy |
Hash Table, String, Sorting |
0257 |
Binary Tree Paths |
Solution |
Easy |
String, Backtracking, Tree, Depth-First Search, Binary Tree |
0260 |
Single Number III |
Solution |
Medium |
Bit Manipulation |
0268 |
Missing Number |
Solution |
Easy |
Array, Math |
0284 |
Peeking Iterator |
Solution |
Medium |
Array Design, Iterator |
0289 |
Game of Life |
Solution |
Medium |
Array, Matrix, Simulation |
0303 |
Range Sum Query - Immutable |
Solution |
Easy |
Array, Design, Prefix Sum |
0304 |
Range Sum Query 2D - Immutable |
Solution |
Medium |
Array, Design, Matrix, Prefix Sum |
0344 |
Reverse String |
Solution |
Easy |
Two Pointers, String |
0345 |
Reverse Vowels of a String |
Solution |
Easy |
Two Pointers, String |
0347 |
Top K Frequent Elements |
Solution |
Medium |
Array, Hash Table, Heap(Priority Queue), Counting |
0349 |
Intersection of Two Arrays |
Solution |
Easy |
Array |
0367 |
Valid Perfect Square |
Solution |
Easy |
Binary Search, Math |
0376 |
Wiggle Subsequence |
Solution |
Medium |
Array, Greedy |
0387 |
First Unique Character in a String |
Solution |
Easy |
String, Hash Table |
0406 |
Queue Reconstruction by Height |
Solution |
Medium |
Array, Greedy, Sorting |
0410 |
Split Array Largest Sum |
Solution |
Hard |
Binary Search, Array, Greedy |
0412 |
Fizz Buzz |
Solution |
Easy |
Math, String |
0451 |
Sort Characters By Frequency |
Solution |
Medium |
Hash Table, String, Heap(Priority Queue), Counting |
0454 |
4Sum II |
Solution |
Medium |
Array, Hash Table |
0456 |
132 Pattern |
Solution |
Medium |
Array, Stack, Monotonic Stack |
0461 |
Hamming Distance |
Solution |
Easy |
Bit Manipulation |
0462 |
Minimum Moves to Equal Array Elements II |
Solution |
Medium |
Array, Math, Sorting |
0473 |
Matchsticks to Square |
Solution |
Medium |
Array, Backtracking |
0477 |
Total Hamming Distance |
Solution |
Medium |
Bit Manipulation |
0485 |
Max Consecutive Ones |
Solution |
Easy |
Array |
0496 |
Next Greater Element I |
Solution |
Easy |
Array, Stack, Hash Table |
0500 |
Keyboard Problem |
Solution |
Easy |
Array, String |
0503 |
Next Greater Element II |
Solution |
Medium |
Array, Stack |
0509 |
Fibonacci Number |
Solution |
Easy |
Math, Dynamic Programming, Recursion, Memoization |
0515 |
Find Largest Value in Each Tree Row |
Solution |
Medium |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
0523 |
Continuous Subarray Sum |
Solution |
Medium |
Array, Hash Table, Math, Prefix Sum |
0532 |
K-diff Pairs in an Array |
Solution |
Medium |
Array, Hash Table |
0535 |
Encode and Decode TinyURL |
Solution |
Medium |
Hash Table, String, Design, Hash Function |
0537 |
Complex Number Multiplication |
Solution |
Medium |
String, Math |
0538 |
Convert BST to Greater Tree |
Solution |
Medium |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
0540 |
Single Element in a Sorted Array |
Solution |
Medium |
Binary Search, Array |
0543 |
Diameter of Binary Tree |
Solution |
Easy |
Tree, Depth-First Search, Binary Tree |
0556 |
Next Greater Element III |
Solution |
Medium |
Math, String |
0560 |
Subarray Sum Equals K |
Solution |
Medium |
Array, Hash Table, Prefix Sum |
0576 |
Out of Boundary Paths |
Solution |
Medium |
Dynamic Programming |
0581 |
Shortest Unsorted Continuous Subarray |
Solution |
Medium |
Array, Two Pointers, Sorting |
0662 |
Maximum Width of Binary Tree |
Solution |
Medium |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
0665 |
Non-decreasing Array |
Solution |
Medium |
Array |
0669 |
Trim a Binary Search Tree |
Solution |
Medium |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
0671 |
Second Minimum Node In a Binary Tree |
Solution |
Easy |
Tree, Depth-First Search, Binary Tree |
0680 |
Valid Palindrome II |
Solution |
Easy |
Two Pointers, String |
0682 |
Baseball Game |
Solution |
Easy |
Array, Stack, Simulation |
0693 |
Binary Number with Alternating Bits |
Solution |
Easy |
Bit Manipulation |
0700 |
Search in a Binary Search Tree |
Solution |
Easy |
Tree, Binary Search Tree, Binary Tree |
0703 |
Kth Largest Element in a Stream |
Solution |
Easy |
Design, Heap(Priority Queue), Data Stream |
0704 |
Binary Search |
Solution |
Easy |
Binary Search |
0705 |
Design HashSet |
Solution |
Easy |
Array, Hash Table, Linked List, Design, Hash Function |
0706 |
Design HashMap |
Solution |
Easy |
Array, Hash Table, Linked List, Design, Hash Function |
0709 |
To Lower Case |
Solution |
Easy |
String |
0735 |
Asteroid Collision |
Solution |
Medium |
Array, Stack |
0739 |
Daily Temperatures |
Solution |
Medium |
Array, Stack |
0744 |
Find Smallest Letter Greater Than Target |
Solution |
Easy |
Binary Search, Array |
0746 |
Min Cost Climbing Stairs |
Solution |
Easy |
Array, Dynamic Programming |
0771 |
Jewels and Stones |
Solution |
Easy |
String, Hash Table |
0784 |
Letter Case Permutation |
Solution |
Medium |
String, Backtracking |
0844 |
Backspace String Compare |
Solution |
Easy |
String, Stack, Simulation |
0852 |
Peak Index in a Mountain Array |
Solution |
Easy |
Binary Search, Array |
0867 |
Transpose Matrix |
Solution |
Easy |
Array, Matrix, Simulation |
0876 |
Middle of the Linked List |
Solution |
Easy |
Linked List, Two Pointers |
0890 |
Find and Replace Pattern |
Solution |
Medium |
String, Hash Table |
0905 |
Sort Array By Parity |
Solution |
Easy |
Array, Two Pointers, Sorting |
0921 |
Minimum Add to Make Parentheses Valid |
Solution |
Medium |
String |
0923 |
3Sum With Multiplicity |
Solution |
Medium |
Array, Hash Table, Two Pointers, Counting, Sorting |
0929 |
Unique Email Address |
Solution |
Easy |
String |
0917 |
Reverse Only Letters |
Solution |
Easy |
Two Pointers, String |
0977 |
Squares of a Sorted Array |
Solution |
Easy |
Two Pointers, Array |
1011 |
Capacity To Ship Packages Within D Days |
Solution |
Medium |
Binary Search, Array, Greedy |
1022 |
Sum of Root To Leaf Binary Numbers |
Solution |
Easy |
Tree, Depth-First Search, Binary Tree |
1038 |
Binary Search Tree to Greater Sum Tree |
Solution |
Medium |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
1041 |
Robot Bounded in Circle |
Solution |
Medium |
String, Math |
1046 |
Last Stone Weight |
Solution |
Easy |
Array, Heap(Priority Queue) |
1047 |
Remove All Adjacent Duplicates In String |
Solution |
Easy |
String, Stack |
1074 |
Number of Submatrices That Sum to Target |
Solution |
Hard |
Array, Hash Table, Matrix, Prefix Sum |
1108 |
Defanging an IP Address |
Solution |
Easy |
String |
1121 |
Split a String in Balanced Strings |
Solution |
Easy |
String |
1209 |
Remove All Adjacent Duplicates in String II |
Solution |
Medium |
String, Stack |
1260 |
Shift 2D Grid |
Solution |
Easy |
Array, Matrix, Simulation |
1281 |
Subtract the Product and Sum of Digits of an Integer |
Solution |
Easy |
Math |
1283 |
Find the Smallest Divisor Given a Threshold |
Solution |
Medium |
Binary Search, Array |
1299 |
Replace Elements with Greatest Element on Right Side |
Solution |
Easy |
Array |
1302 |
Deepest Leaves Sum |
Solution |
Medium |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
1332 |
Remove Palindromic Subsequences |
Solution |
Easy |
Two Pointers, String |
1347 |
Minimum number od Steps to make two Strings Anagrams |
Solution |
Medium |
String |
1354 |
Construct Target Array With Multiple Sums |
Solution |
Medium |
Array, Heap(Priority Queue) |
1365 |
How Many Numbers Are Smaller Than the Current Number |
Solution |
Easy |
Array |
1379 |
Find a Corresponding Node of a Binary Tree in a Clone of That Tree |
Solution |
Medium |
Tree, Depth-First Search, Binary Search Tree, Binary Tree |
1396 |
Design Underground System |
Solution |
Medium |
Hash Table, String, Design |
1423 |
Maximum Points You Can Obtain from Cards |
Solution |
Medium |
Array, Sliding Window, Prefix Sum |
1431 |
Kids With the Greatest Number of Candies |
Solution |
Easy |
Array |
1461 |
Check If a String Contains All Binary Codes of Size K |
Solution |
Medium |
Hash Table, String |
1465 |
Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts |
Solution |
Medium |
Array, Greedy, Sorting |
1470 |
Shuffle the Array |
Solution |
Easy |
Array |
1480 |
Running Sum of 1d Array |
Solution |
Easy |
Array, Prefix Sum |
1486 |
XOR Operation in an Array |
Solution |
Easy |
Array |
1512 |
Number of Good Pairs |
Solution |
Easy |
Array |
1518 |
Water Bottles |
Solution |
Easy |
Array |
1528 |
Shuffle String |
Solution |
Easy |
String |
1589 |
Crawler Log Folder |
Solution |
Easy |
Array, String, Stack |
1614 |
Maximum Nesting Depth of the Parentheses |
Solution |
Easy |
String |
1636 |
Sort Array by Increasing Frequency |
Solution |
Easy |
Array, Hash Table, Sorting |
1642 |
Furthest Building You Can Reach |
Solution |
Medium |
Array, Greedy, Heap(Priority Queue) |
1647 |
Minimum Deletions to Make Character Frequencies Unique |
Solution |
Medium |
String, Greedy, Sorting |
1662 |
Check If Two String Arrays are Equivalent |
Solution |
Easy |
Array, String |
1672 |
Richest Customer Wealth |
Solution |
Easy |
Array |
1678 |
Goal Parser Interpretation |
Solution |
Easy |
String |
1679 |
Max Number of K-Sum Pairs |
Solution |
Medium |
Array, Hash Table, Two Pointers, Sorting |
1684 |
Count the Number of Consistent Strings |
Solution |
Easy |
String |
1689 |
Partitioning Into Minimum Number Of Deci-Binary Numbers |
Solution |
Medium |
String, Greedy |
1695 |
Maximum Erasure Value |
Solution |
Medium |
Array, Hash Table, Sliding Window |
1696 |
Jump Game VI |
Solution |
Medium |
Array, Dynamic Programming, Queue, Sliding Window, Heap(Priority Queue), Monotonic Queue |
1710 |
Maximum Units on a Truck |
Solution |
Easy |
Array, Greedy, Sorting |
1721 |
Swapping Nodes in a Linked List |
Solution |
Medium |
Linked List, Two Pointers |
1773 |
Count Items Matching a Rule |
Solution |
Easy |
String |
1816 |
Truncate Sentence |
Solution |
Easy |
String |
1832 |
Check if the Sentence is Pangram |
Solution |
Easy |
String, Hash Table |
1859 |
Sorting the sentence |
Solution |
Easy |
String |
1880 |
Check if Word Equals Summation of Two Words |
Solution |
Easy |
String |
1886 |
Determine Whether Matrix Can Be Obtained By Rotation |
Solution |
Easy |
Array, Matrix |
1925 |
Count Square Sum Triples |
Solution |
Easy |
Math |
1985 |
Find the Kth Largest Integer in the Array |
Solution |
Medium |
Array, String, Heap(Priority Queue) |
2099 |
Find Subsequence of Length K With the Largest Sum |
Solution |
Easy |
Array, Hash Table, Sorting, Heap(Priority Queue) |
2108 |
Find First Palindromic String in the Array |
Solution |
Easy |
Array, Two Pointers, String |
2177 |
Find Three Consecutive Integers That Sum to a Given Number |
Solution |
Medium |
Math, Simulation |
2233 |
Maximum Product After K Increments |
Solution |
Medium |
Array, Greedy, Heap(Priority Queue) |
2279 |
Maximum Bags With Full Capacity of Rocks |
Solution |
Medium |
Array, Greedy, Sorting |