Java-based LeetCode algorithm problem solutions, regularly updated.
To configure your Maven project, add the following code to your pom.xml file:
<dependencies>
<dependency>
<groupId>com.github.javadev</groupId>
<artifactId>leetcode-in-java</artifactId>
<version>1.34</version>
</dependency>
...
</dependencies>
Gradle configuration:
implementation 'com.github.javadev:leetcode-in-java:1.34'
- Level 2
- Udemy
- Data Structure I
- Data Structure II
- Algorithm I
- Algorithm II
- Binary Search I
- Binary Search II
- Dynamic Programming I
- Programming Skills I
- Programming Skills II
- Graph Theory I
- SQL I
- Level 1
0202 | Happy Number | Easy | Top_Interview_Questions, Hash_Table, Math, Two_Pointers | 1 | 98.59 |
0054 | Spiral Matrix | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Matrix, Simulation | 0 | 100.00 |
1706 | Where Will the Ball Fall | Medium | Array, Dynamic_Programming, Depth_First_Search, Matrix, Simulation | 2 | 64.55 |
0014 | Longest Common Prefix | Easy | Top_100_Liked_Questions, Top_Interview_Questions, String | 0 | 100.00 |
0043 | Multiply Strings | Medium | String, Math, Simulation | 1 | 100.00 |
0019 | Remove Nth Node From End of List | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Two_Pointers, Linked_List, Big_O_Time_O(L)_Space_O(L) | 0 | 100.00 |
0234 | Palindrome Linked List | Easy | Top_100_Liked_Questions, Two_Pointers, Stack, Linked_List, Recursion, Big_O_Time_O(n)_Space_O(1) | 6 | 76.07 |
0328 | Odd Even Linked List | Medium | Linked_List | 0 | 100.00 |
0148 | Sort List | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Sorting, Two_Pointers, Linked_List, Divide_and_Conquer, Merge_Sort, Big_O_Time_O(log(N))_Space_O(log(N)) | 12 | 85.82 |
2131 | Longest Palindrome by Concatenating Two Letter Words | Medium | Array, String, Hash_Table, Greedy, Counting | 73 | 76.60 |
0621 | Task Scheduler | Medium | Array, Hash_Table, Sorting, Greedy, Heap_Priority_Queue, Counting | 3 | 84.32 |
0226 | Invert Binary Tree | Easy | Top_100_Liked_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0110 | Balanced Binary Tree | Easy | Depth_First_Search, Tree, Binary_Tree | 1 | 98.82 |
0543 | Diameter of Binary Tree | Easy | Top_100_Liked_Questions, Depth_First_Search, Tree, Binary_Tree, Big_O_Time_O(n)_Space_O(n) | 1 | 65.86 |
0437 | Path Sum III | Medium | Depth_First_Search, Tree, Binary_Tree, Big_O_Time_O(n)_Space_O(n) | 18 | 45.66 |
0074 | Search a 2D Matrix | Medium | Top_100_Liked_Questions, Array, Binary_Search, Matrix, Big_O_Time_O(endRow+endCol)_Space_O(1) | 0 | 100.00 |
0033 | Search in Rotated Sorted Array | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 0 | 100.00 |
0108 | Convert Sorted Array to Binary Search Tree | Easy | Top_Interview_Questions, Array, Tree, Binary_Tree, Binary_Search_Tree, Divide_and_Conquer | 0 | 100.00 |
0230 | Kth Smallest Element in a BST | Medium | Top_100_Liked_Questions, Depth_First_Search, Tree, Binary_Tree, Binary_Search_Tree, Big_O_Time_O(n)_Space_O(n) | 1 | 78.91 |
0173 | Binary Search Tree Iterator | Medium | Tree, Binary_Tree, Stack, Design, Binary_Search_Tree, Iterator | 18 | 84.18 |
0994 | Rotting Oranges | Medium | Top_100_Liked_Questions, Array, Breadth_First_Search, Matrix | 3 | 74.27 |
0417 | Pacific Atlantic Water Flow | Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix | 5 | 92.62 |
0210 | Course Schedule II | Medium | Top_Interview_Questions, Depth_First_Search, Breadth_First_Search, Graph, Topological_Sort | 13 | 35.17 |
0815 | Bus Routes | Hard | Array, Hash_Table, Breadth_First_Search | 49 | 89.11 |
0198 | House Robber | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0322 | Coin Change | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Breadth_First_Search, Big_O_Time_O(m*n)_Space_O(amount) | 17 | 91.77 |
0416 | Partition Equal Subset Sum | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Big_O_Time_O(n*sums)_Space_O(n*sums) | 27 | 94.53 |
0152 | Maximum Product Subarray | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(N)_Space_O(1) | 1 | 92.31 |
0003 | Longest Substring Without Repeating Characters | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Sliding_Window, Big_O_Time_O(n)_Space_O(1) | 2 | 99.52 |
0016 | 3Sum Closest | Medium | Array, Sorting, Two_Pointers | 4 | 98.21 |
0076 | Minimum Window Substring | Hard | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Sliding_Window, Big_O_Time_O(s.length())_Space_O(1) | 2 | 99.94 |
0100 | Same Tree | Easy | Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 0 | 100.00 |
0101 | Symmetric Tree | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(log(N)) | 0 | 100.00 |
0199 | Binary Tree Right Side View | Medium | Top_100_Liked_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 1 | 94.57 |
0232 | Implement Queue using Stacks | Easy | Stack, Design, Queue | 1 | 67.21 |
0155 | Min Stack | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Stack, Design, Big_O_Time_O(1)_Space_O(N) | 3 | 100.00 |
0208 | Implement Trie (Prefix Tree) | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Design, Trie, Big_O_Time_O(word.length())_or_O(prefix.length())_Space_O(N) | 34 | 99.90 |
0057 | Insert Interval | Medium | Array | 0 | 100.00 |
0056 | Merge Intervals | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Big_O_Time_O(n_log_n)_Space_O(n) | 8 | 96.27 |
0735 | Asteroid Collision | Medium | Array, Stack | 2 | 99.59 |
0227 | Basic Calculator II | Medium | String, Math, Stack | 8 | 95.32 |
0547 | Number of Provinces | Medium | Depth_First_Search, Breadth_First_Search, Graph, Union_Find | 2 | 69.51 |
0947 | Most Stones Removed with Same Row or Column | Medium | Depth_First_Search, Graph, Union_Find | 7 | 98.83 |
0039 | Combination Sum | Medium | Top_100_Liked_Questions, Array, Backtracking, Big_O_Time_O(2^n)_Space_O(n+2^n) | 1 | 100.00 |
0046 | Permutations | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Backtracking, Big_O_Time_O(n*n!)_Space_O(n+n!) | 1 | 95.07 |
0412 | Fizz Buzz | Easy | String, Math, Simulation | 1 | 100.00 |
0136 | Single Number | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Bit_Manipulation, Big_O_Time_O(N)_Space_O(1) | 1 | 99.97 |
0007 | Reverse Integer | Medium | Top_Interview_Questions, Math | 1 | 96.61 |
0009 | Palindrome Number | Easy | Math | 5 | 77.91 |
0172 | Factorial Trailing Zeroes | Medium | Top_Interview_Questions, Math | 1 | 85.61 |
0050 | Pow(x, n) | Medium | Top_Interview_Questions, Math, Recursion | 0 | 100.00 |
0344 | Reverse String | Easy | String, Two_Pointers, Recursion | 1 | 99.91 |
0014 | Longest Common Prefix | Easy | Top_100_Liked_Questions, Top_Interview_Questions, String | 0 | 100.00 |
0187 | Repeated DNA Sequences | Medium | String, Hash_Table, Bit_Manipulation, Sliding_Window, Hash_Function, Rolling_Hash | 29 | 77.11 |
0003 | Longest Substring Without Repeating Characters | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Sliding_Window, Big_O_Time_O(n)_Space_O(1) | 2 | 99.52 |
0020 | Valid Parentheses | Easy | Top_100_Liked_Questions, Top_Interview_Questions, String, Stack, Big_O_Time_O(n)_Space_O(n) | 1 | 98.78 |
0005 | Longest Palindromic Substring | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 7 | 96.96 |
0394 | Decode String | Medium | Top_100_Liked_Questions, String, Stack, Recursion, Big_O_Time_O(n)_Space_O(n) | 1 | 87.68 |
0242 | Valid Anagram | Easy | String, Hash_Table, Sorting | 2 | 99.01 |
0049 | Group Anagrams | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, String, Hash_Table, Sorting, Big_O_Time_O(n*k_log_k)_Space_O(n) | 6 | 92.28 |
0151 | Reverse Words in a String | Medium | String, Two_Pointers | 2 | 99.94 |
0273 | Integer to English Words | Hard | String, Math, Recursion | 3 | 95.67 |
0704 | Binary Search | Easy | Top_100_Liked_Questions, Array, Binary_Search | 0 | 100.00 |
0033 | Search in Rotated Sorted Array | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 0 | 100.00 |
0153 | Find Minimum in Rotated Sorted Array | Medium | Top_100_Liked_Questions, Array, Binary_Search, Big_O_Time_O(log_N)_Space_O(log_N) | 0 | 100.00 |
0121 | Best Time to Buy and Sell Stock | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(N)_Space_O(1) | 1 | 100.00 |
0283 | Move Zeroes | Easy | Top_100_Liked_Questions, Array, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 2 | 79.54 |
0001 | Two Sum | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Hash_Table, Big_O_Time_O(n)_Space_O(n) | 2 | 85.97 |
0217 | Contains Duplicate | Easy | Top_Interview_Questions, Array, Hash_Table, Sorting | 6 | 96.68 |
0058 | Length of Last Word | Easy | String | 0 | 100.00 |
0605 | Can Place Flowers | Easy | Array, Greedy | 1 | 96.77 |
0122 | Best Time to Buy and Sell Stock II | Medium | Top_Interview_Questions, Array, Dynamic_Programming, Greedy | 1 | 96.82 |
0080 | Remove Duplicates from Sorted Array II | Medium | Array, Two_Pointers | 0 | 100.00 |
0189 | Rotate Array | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Math, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 0 | 100.00 |
0055 | Jump Game | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Greedy, Big_O_Time_O(n)_Space_O(1) | 2 | 79.47 |
0075 | Sort Colors | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 0 | 100.00 |
0066 | Plus One | Easy | Top_Interview_Questions, Array, Math | 0 | 100.00 |
0238 | Product of Array Except Self | Medium | Top_100_Liked_Questions, Array, Prefix_Sum, Big_O_Time_O(n^2)_Space_O(n) | 1 | 100.00 |
1291 | Sequential Digits | Medium | Enumeration | 0 | 100.00 |
0448 | Find All Numbers Disappeared in an Array | Easy | Array, Hash_Table | 3 | 100.00 |
0442 | Find All Duplicates in an Array | Medium | Array, Hash_Table | 5 | 98.83 |
0041 | First Missing Positive | Hard | Top_100_Liked_Questions, Top_Interview_Questions, Array, Hash_Table, Big_O_Time_O(n)_Space_O(n) | 2 | 57.59 |
0697 | Degree of an Array | Easy | Array, Hash_Table | 14 | 93.19 |
0532 | K-diff Pairs in an Array | Medium | Array, Hash_Table, Sorting, Binary_Search, Two_Pointers | 13 | 58.23 |
0713 | Subarray Product Less Than K | Medium | Array, Sliding_Window | 8 | 39.00 |
1007 | Minimum Domino Rotations For Equal Row | Medium | Array, Greedy | 5 | 79.64 |
1306 | Jump Game III | Medium | Array, Depth_First_Search, Breadth_First_Search | 2 | 96.23 |
0456 | 132 Pattern | Medium | Array, Binary_Search, Stack, Ordered_Set, Monotonic_Stack | 16 | 82.41 |
0239 | Sliding Window Maximum | Hard | Top_100_Liked_Questions, Array, Heap_Priority_Queue, Sliding_Window, Queue, Monotonic_Queue, Big_O_Time_O(n*k)_Space_O(n+k) | 58 | 52.28 |
0392 | Is Subsequence | Easy | String, Dynamic_Programming, Two_Pointers | 1 | 93.01 |
0125 | Valid Palindrome | Easy | Top_Interview_Questions, String, Two_Pointers | 3 | 98.64 |
0977 | Squares of a Sorted Array | Easy | Array, Sorting, Two_Pointers | 1 | 100.00 |
0026 | Remove Duplicates from Sorted Array | Easy | Top_Interview_Questions, Array, Two_Pointers | 1 | 98.56 |
0042 | Trapping Rain Water | Hard | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Two_Pointers, Stack, Monotonic_Stack, Big_O_Time_O(n)_Space_O(1) | 0 | 100.00 |
0015 | 3Sum | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Two_Pointers, Big_O_Time_O(n*log(n))_Space_O(n^2) | 29 | 82.24 |
0053 | Maximum Subarray | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Divide_and_Conquer, Big_O_Time_O(n)_Space_O(1) | 1 | 100.00 |
0169 | Majority Element | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Hash_Table, Sorting, Counting, Divide_and_Conquer, Big_O_Time_O(n)_Space_O(1) | 1 | 100.00 |
0912 | Sort an Array | Medium | Array, Sorting, Heap_Priority_Queue, Divide_and_Conquer, Merge_Sort, Bucket_Sort, Counting_Sort, Radix_Sort | 25 | 38.15 |
0304 | Range Sum Query 2D - Immutable | Medium | Array, Matrix, Design, Prefix_Sum | 153 | 87.51 |
0074 | Search a 2D Matrix | Medium | Top_100_Liked_Questions, Array, Binary_Search, Matrix, Big_O_Time_O(endRow+endCol)_Space_O(1) | 0 | 100.00 |
0054 | Spiral Matrix | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Matrix, Simulation | 0 | 100.00 |
0048 | Rotate Image | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Math, Matrix, Big_O_Time_O(n^2)_Space_O(1) | 0 | 100.00 |
1572 | Matrix Diagonal Sum | Easy | Array, Matrix | 0 | 100.00 |
0073 | Set Matrix Zeroes | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Hash_Table, Matrix, Big_O_Time_O(m*n)_Space_O(1) | 1 | 79.07 |
0056 | Merge Intervals | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Big_O_Time_O(n_log_n)_Space_O(n) | 8 | 96.27 |
0114 | Flatten Binary Tree to Linked List | Medium | Top_100_Liked_Questions, Depth_First_Search, Tree, Binary_Tree, Stack, Linked_List, Big_O_Time_O(N)_Space_O(N) | 1 | 75.27 |
0445 | Add Two Numbers II | Medium | Math, Stack, Linked_List | 3 | 90.38 |
0328 | Odd Even Linked List | Medium | Linked_List | 0 | 100.00 |
0061 | Rotate List | Medium | Two_Pointers, Linked_List | 0 | 100.00 |
0024 | Swap Nodes in Pairs | Medium | Top_100_Liked_Questions, Linked_List, Recursion, Big_O_Time_O(n)_Space_O(1) | 0 | 100.00 |
0876 | Middle of the Linked List | Easy | Two_Pointers, Linked_List | 0 | 100.00 |
0142 | Linked List Cycle II | Medium | Top_100_Liked_Questions, Hash_Table, Two_Pointers, Linked_List, Big_O_Time_O(N)_Space_O(1) | 0 | 100.00 |
0141 | Linked List Cycle | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Hash_Table, Two_Pointers, Linked_List, Big_O_Time_O(N)_Space_O(1) | 0 | 100.00 |
0206 | Reverse Linked List | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Linked_List, Recursion, Big_O_Time_O(N)_Space_O(1) | 0 | 100.00 |
0021 | Merge Two Sorted Lists | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Linked_List, Recursion, Big_O_Time_O(m+n)_Space_O(m+n) | 0 | 100.00 |
0160 | Intersection of Two Linked Lists | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Hash_Table, Two_Pointers, Linked_List, Big_O_Time_O(M+N)_Space_O(1) | 1 | 99.68 |
0234 | Palindrome Linked List | Easy | Top_100_Liked_Questions, Two_Pointers, Stack, Linked_List, Recursion, Big_O_Time_O(n)_Space_O(1) | 6 | 76.07 |
0138 | Copy List with Random Pointer | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Hash_Table, Linked_List, Big_O_Time_O(N)_Space_O(N) | 0 | 100.00 |
0025 | Reverse Nodes in k-Group | Hard | Top_100_Liked_Questions, Linked_List, Recursion, Big_O_Time_O(n)_Space_O(k) | 0 | 100.00 |
0146 | LRU Cache | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Hash_Table, Design, Linked_List, Doubly_Linked_List, Big_O_Time_O(1)_Space_O(capacity) | 87 | 50.80 |
0707 | Design Linked List | Medium | Design, Linked_List | 10 | 70.60 |
0144 | Binary Tree Preorder Traversal | Easy | Depth_First_Search, Tree, Binary_Tree, Stack | 1 | 48.38 |
0094 | Binary Tree Inorder Traversal | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Tree, Binary_Tree, Stack, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0145 | Binary Tree Postorder Traversal | Easy | Depth_First_Search, Tree, Binary_Tree, Stack | 1 | 49.11 |
0102 | Binary Tree Level Order Traversal | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(N) | 1 | 91.09 |
0103 | Binary Tree Zigzag Level Order Traversal | Medium | Top_Interview_Questions, Breadth_First_Search, Tree, Binary_Tree | 1 | 95.00 |
0108 | Convert Sorted Array to Binary Search Tree | Easy | Top_Interview_Questions, Array, Tree, Binary_Tree, Binary_Search_Tree, Divide_and_Conquer | 0 | 100.00 |
1008 | Construct Binary Search Tree from Preorder Traversal | Medium | Array, Tree, Binary_Tree, Stack, Monotonic_Stack, Binary_Search_Tree | 0 | 100.00 |
0543 | Diameter of Binary Tree | Easy | Top_100_Liked_Questions, Depth_First_Search, Tree, Binary_Tree, Big_O_Time_O(n)_Space_O(n) | 1 | 65.86 |
0938 | Range Sum of BST | Easy | Depth_First_Search, Tree, Binary_Tree, Binary_Search_Tree | 0 | 100.00 |
0100 | Same Tree | Easy | Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 0 | 100.00 |
0226 | Invert Binary Tree | Easy | Top_100_Liked_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0111 | Minimum Depth of Binary Tree | Easy | Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 1 | 97.49 |
0104 | Maximum Depth of Binary Tree | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(H) | 0 | 100.00 |
0110 | Balanced Binary Tree | Easy | Depth_First_Search, Tree, Binary_Tree | 1 | 98.82 |
0701 | Insert into a Binary Search Tree | Medium | Tree, Binary_Tree, Binary_Search_Tree | 0 | 100.00 |
0297 | Serialize and Deserialize Binary Tree | Hard | String, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Design | 7 | 98.13 |
0124 | Binary Tree Maximum Path Sum | Hard | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Depth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(N) | 1 | 99.46 |
0098 | Validate Binary Search Tree | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Tree, Binary_Tree, Binary_Search_Tree, Big_O_Time_O(N)_Space_O(log(N)) | 0 | 100.00 |
0337 | House Robber III | Medium | Dynamic_Programming, Depth_First_Search, Tree, Binary_Tree | 1 | 91.77 |
0236 | Lowest Common Ancestor of a Binary Tree | Medium | Top_100_Liked_Questions, Depth_First_Search, Tree, Binary_Tree, Big_O_Time_O(n)_Space_O(n) | 10 | 56.51 |
0968 | Binary Tree Cameras | Hard | Dynamic_Programming, Depth_First_Search, Tree, Binary_Tree | 0 | 100.00 |
0208 | Implement Trie (Prefix Tree) | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Design, Trie, Big_O_Time_O(word.length())_or_O(prefix.length())_Space_O(N) | 34 | 99.90 |
0745 | Prefix and Suffix Search | Hard | String, Design, Trie | 366 | 76.15 |
0200 | Number of Islands | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find, Big_O_Time_O(M*N)_Space_O(M*N) | 3 | 97.76 |
0133 | Clone Graph | Medium | Hash_Table, Depth_First_Search, Breadth_First_Search, Graph | 45 | 29.80 |
0417 | Pacific Atlantic Water Flow | Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix | 5 | 92.62 |
0120 | Triangle | Medium | Array, Dynamic_Programming | 2 | 94.63 |
0118 | Pascal's Triangle | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming | 1 | 67.08 |
0119 | Pascal's Triangle II | Easy | Array, Dynamic_Programming | 0 | 100.00 |
0139 | Word Break | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Dynamic_Programming, Trie, Memoization, Big_O_Time_O(M+max*N)_Space_O(M+N+max) | 2 | 97.08 |
0152 | Maximum Product Subarray | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(N)_Space_O(1) | 1 | 92.31 |
0198 | House Robber | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0213 | House Robber II | Medium | Array, Dynamic_Programming | 0 | 100.00 |
0509 | Fibonacci Number | Easy | Dynamic_Programming, Math, Recursion, Memoization | 0 | 100.00 |
0070 | Climbing Stairs | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Math, Memoization, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0064 | Minimum Path Sum | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Matrix, Big_O_Time_O(m*n)_Space_O(m*n) | 0 | 100.00 |
0300 | Longest Increasing Subsequence | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Binary_Search, Big_O_Time_O(n*log_n)_Space_O(n) | 3 | 98.63 |
1143 | Longest Common Subsequence | Medium | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n*m)_Space_O(n*m) | 33 | 46.23 |
0072 | Edit Distance | Medium | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n^2)_Space_O(n2) | 4 | 90.13 |
0044 | Wildcard Matching | Hard | Top_Interview_Questions, String, Dynamic_Programming, Greedy, Recursion | 2 | 99.87 |
0010 | Regular Expression Matching | Hard | Top_Interview_Questions, String, Dynamic_Programming, Recursion, Big_O_Time_O(m*n)_Space_O(m*n) | 1 | 100.00 |
0022 | Generate Parentheses | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Backtracking, Big_O_Time_O(2^n)_Space_O(n) | 0 | 100.00 |
0039 | Combination Sum | Medium | Top_100_Liked_Questions, Array, Backtracking, Big_O_Time_O(2^n)_Space_O(n+2^n) | 1 | 100.00 |
0216 | Combination Sum III | Medium | Array, Backtracking | 1 | 81.35 |
0078 | Subsets | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Bit_Manipulation, Backtracking, Big_O_Time_O(2^n)_Space_O(n*2^n) | 1 | 70.60 |
0017 | Letter Combinations of a Phone Number | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Backtracking, Big_O_Time_O(4^n)_Space_O(n) | 0 | 100.00 |
0046 | Permutations | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Backtracking, Big_O_Time_O(n*n!)_Space_O(n+n!) | 1 | 95.07 |
0191 | Number of 1 Bits | Easy | Top_Interview_Questions, Bit_Manipulation | 1 | 84.87 |
0389 | Find the Difference | Easy | String, Hash_Table, Sorting, Bit_Manipulation | 1 | 100.00 |
0190 | Reverse Bits | Easy | Top_Interview_Questions, Bit_Manipulation, Divide_and_Conquer | 1 | 98.66 |
0461 | Hamming Distance | Easy | Bit_Manipulation | 0 | 100.00 |
1009 | Complement of Base 10 Integer | Easy | Bit_Manipulation | 1 | 41.56 |
0338 | Counting Bits | Easy | Dynamic_Programming, Bit_Manipulation, Big_O_Time_O(num)_Space_O(num) | 2 | 86.73 |
0371 | Sum of Two Integers | Medium | Math, Bit_Manipulation | 0 | 100.00 |
0029 | Divide Two Integers | Medium | Top_Interview_Questions, Math, Bit_Manipulation | 1 | 97.44 |
0155 | Min Stack | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Stack, Design, Big_O_Time_O(1)_Space_O(N) | 3 | 100.00 |
0217 | Contains Duplicate | Easy | Top_Interview_Questions, Array, Hash_Table, Sorting | 6 | 96.68 |
0053 | Maximum Subarray | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Divide_and_Conquer, Big_O_Time_O(n)_Space_O(1) | 1 | 100.00 |
0001 | Two Sum | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Hash_Table, Big_O_Time_O(n)_Space_O(n) | 2 | 85.97 |
0088 | Merge Sorted Array | Easy | Top_Interview_Questions, Array, Sorting, Two_Pointers | 0 | 100.00 |
0350 | Intersection of Two Arrays II | Easy | Array, Hash_Table, Sorting, Binary_Search, Two_Pointers | 4 | 69.62 |
0121 | Best Time to Buy and Sell Stock | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(N)_Space_O(1) | 1 | 100.00 |
0566 | Reshape the Matrix | Easy | Array, Matrix, Simulation | 1 | 90.08 |
0118 | Pascal's Triangle | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming | 1 | 67.08 |
0036 | Valid Sudoku | Medium | Top_Interview_Questions, Array, Hash_Table, Matrix | 1 | 100.00 |
0074 | Search a 2D Matrix | Medium | Top_100_Liked_Questions, Array, Binary_Search, Matrix, Big_O_Time_O(endRow+endCol)_Space_O(1) | 0 | 100.00 |
0387 | First Unique Character in a String | Easy | String, Hash_Table, Counting, Queue | 1 | 100.00 |
0383 | Ransom Note | Easy | String, Hash_Table, Counting | 1 | 99.97 |
0242 | Valid Anagram | Easy | String, Hash_Table, Sorting | 2 | 99.01 |
0141 | Linked List Cycle | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Hash_Table, Two_Pointers, Linked_List, Big_O_Time_O(N)_Space_O(1) | 0 | 100.00 |
0021 | Merge Two Sorted Lists | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Linked_List, Recursion, Big_O_Time_O(m+n)_Space_O(m+n) | 0 | 100.00 |
0203 | Remove Linked List Elements | Easy | Linked_List, Recursion | 1 | 98.82 |
0206 | Reverse Linked List | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Linked_List, Recursion, Big_O_Time_O(N)_Space_O(1) | 0 | 100.00 |
0083 | Remove Duplicates from Sorted List | Easy | Linked_List | 0 | 100.00 |
0020 | Valid Parentheses | Easy | Top_100_Liked_Questions, Top_Interview_Questions, String, Stack, Big_O_Time_O(n)_Space_O(n) | 1 | 98.78 |
0232 | Implement Queue using Stacks | Easy | Stack, Design, Queue | 1 | 67.21 |
0144 | Binary Tree Preorder Traversal | Easy | Depth_First_Search, Tree, Binary_Tree, Stack | 1 | 48.38 |
0094 | Binary Tree Inorder Traversal | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Tree, Binary_Tree, Stack, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0145 | Binary Tree Postorder Traversal | Easy | Depth_First_Search, Tree, Binary_Tree, Stack | 1 | 49.11 |
0102 | Binary Tree Level Order Traversal | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(N) | 1 | 91.09 |
0104 | Maximum Depth of Binary Tree | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(H) | 0 | 100.00 |
0101 | Symmetric Tree | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(log(N)) | 0 | 100.00 |
0226 | Invert Binary Tree | Easy | Top_100_Liked_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0112 | Path Sum | Easy | Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 0 | 100.00 |
0700 | Search in a Binary Search Tree | Easy | Tree, Binary_Tree, Binary_Search_Tree | 0 | 100.00 |
0701 | Insert into a Binary Search Tree | Medium | Tree, Binary_Tree, Binary_Search_Tree | 0 | 100.00 |
0098 | Validate Binary Search Tree | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Tree, Binary_Tree, Binary_Search_Tree, Big_O_Time_O(N)_Space_O(log(N)) | 0 | 100.00 |
0653 | Two Sum IV - Input is a BST | Easy | Hash_Table, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Two_Pointers, Binary_Search_Tree | 5 | 74.23 |
0235 | Lowest Common Ancestor of a Binary Search Tree | Medium | Depth_First_Search, Tree, Binary_Tree, Binary_Search_Tree | 4 | 100.00 |
0136 | Single Number | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Bit_Manipulation, Big_O_Time_O(N)_Space_O(1) | 1 | 99.97 |
0169 | Majority Element | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Hash_Table, Sorting, Counting, Divide_and_Conquer, Big_O_Time_O(n)_Space_O(1) | 1 | 100.00 |
0015 | 3Sum | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Two_Pointers, Big_O_Time_O(n*log(n))_Space_O(n^2) | 29 | 82.24 |
0075 | Sort Colors | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 0 | 100.00 |
0056 | Merge Intervals | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Big_O_Time_O(n_log_n)_Space_O(n) | 8 | 96.27 |
0706 | Design HashMap | Easy | Array, Hash_Table, Design, Linked_List, Hash_Function | 13 | 95.71 |
0119 | Pascal's Triangle II | Easy | Array, Dynamic_Programming | 0 | 100.00 |
0048 | Rotate Image | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Math, Matrix, Big_O_Time_O(n^2)_Space_O(1) | 0 | 100.00 |
0059 | Spiral Matrix II | Medium | Array, Matrix, Simulation | 0 | 100.00 |
0240 | Search a 2D Matrix II | Medium | Top_100_Liked_Questions, Array, Binary_Search, Matrix, Divide_and_Conquer, Big_O_Time_O(n+m)_Space_O(1) | 7 | 86.73 |
0435 | Non-overlapping Intervals | Medium | Array, Dynamic_Programming, Sorting, Greedy | 96 | 47.37 |
0334 | Increasing Triplet Subsequence | Medium | Array, Greedy | 2 | 99.33 |
0238 | Product of Array Except Self | Medium | Top_100_Liked_Questions, Array, Prefix_Sum, Big_O_Time_O(n^2)_Space_O(n) | 1 | 100.00 |
0560 | Subarray Sum Equals K | Medium | Top_100_Liked_Questions, Array, Hash_Table, Prefix_Sum, Big_O_Time_O(n)_Space_O(n) | 21 | 98.97 |
0415 | Add Strings | Easy | String, Math, Simulation | 3 | 82.41 |
0409 | Longest Palindrome | Easy | String, Hash_Table, Greedy | 2 | 92.90 |
0290 | Word Pattern | Easy | String, Hash_Table | 1 | 97.26 |
0763 | Partition Labels | Medium | String, Hash_Table, Greedy, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 1 | 100.00 |
0049 | Group Anagrams | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, String, Hash_Table, Sorting, Big_O_Time_O(n*k_log_k)_Space_O(n) | 6 | 92.28 |
0043 | Multiply Strings | Medium | String, Math, Simulation | 1 | 100.00 |
0187 | Repeated DNA Sequences | Medium | String, Hash_Table, Bit_Manipulation, Sliding_Window, Hash_Function, Rolling_Hash | 29 | 77.11 |
0005 | Longest Palindromic Substring | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 7 | 96.96 |
0002 | Add Two Numbers | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Math, Linked_List, Recursion, Big_O_Time_O(max(N,M))_Space_O(max(N,M)) | 1 | 100.00 |
0142 | Linked List Cycle II | Medium | Top_100_Liked_Questions, Hash_Table, Two_Pointers, Linked_List, Big_O_Time_O(N)_Space_O(1) | 0 | 100.00 |
0160 | Intersection of Two Linked Lists | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Hash_Table, Two_Pointers, Linked_List, Big_O_Time_O(M+N)_Space_O(1) | 1 | 99.68 |
0082 | Remove Duplicates from Sorted List II | Medium | Two_Pointers, Linked_List | 0 | 100.00 |
0024 | Swap Nodes in Pairs | Medium | Top_100_Liked_Questions, Linked_List, Recursion, Big_O_Time_O(n)_Space_O(1) | 0 | 100.00 |
0707 | Design Linked List | Medium | Design, Linked_List | 10 | 70.60 |
0025 | Reverse Nodes in k-Group | Hard | Top_100_Liked_Questions, Linked_List, Recursion, Big_O_Time_O(n)_Space_O(k) | 0 | 100.00 |
0143 | Reorder List | Medium | Two_Pointers, Stack, Linked_List, Recursion | 2 | 72.59 |
0155 | Min Stack | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Stack, Design, Big_O_Time_O(1)_Space_O(N) | 3 | 100.00 |
1249 | Minimum Remove to Make Valid Parentheses | Medium | String, Stack | 13 | 94.62 |
1823 | Find the Winner of the Circular Game | Medium | Array, Math, Simulation, Recursion, Queue | 3 | 64.85 |
0108 | Convert Sorted Array to Binary Search Tree | Easy | Top_Interview_Questions, Array, Tree, Binary_Tree, Binary_Search_Tree, Divide_and_Conquer | 0 | 100.00 |
0105 | Construct Binary Tree from Preorder and Inorder Traversal | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Hash_Table, Tree, Binary_Tree, Divide_and_Conquer, Big_O_Time_O(N)_Space_O(N) | 3 | 86.35 |
0103 | Binary Tree Zigzag Level Order Traversal | Medium | Top_Interview_Questions, Breadth_First_Search, Tree, Binary_Tree | 1 | 95.00 |
0199 | Binary Tree Right Side View | Medium | Top_100_Liked_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 1 | 94.57 |
0113 | Path Sum II | Medium | Depth_First_Search, Tree, Binary_Tree, Backtracking | 1 | 100.00 |
0450 | Delete Node in a BST | Medium | Tree, Binary_Tree, Binary_Search_Tree | 0 | 100.00 |
0230 | Kth Smallest Element in a BST | Medium | Top_100_Liked_Questions, Depth_First_Search, Tree, Binary_Tree, Binary_Search_Tree, Big_O_Time_O(n)_Space_O(n) | 1 | 78.91 |
0173 | Binary Search Tree Iterator | Medium | Tree, Binary_Tree, Stack, Design, Binary_Search_Tree, Iterator | 18 | 84.18 |
0236 | Lowest Common Ancestor of a Binary Tree | Medium | Top_100_Liked_Questions, Depth_First_Search, Tree, Binary_Tree, Big_O_Time_O(n)_Space_O(n) | 10 | 56.51 |
0297 | Serialize and Deserialize Binary Tree | Hard | String, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Design | 7 | 98.13 |
0997 | Find the Town Judge | Easy | Array, Hash_Table, Graph | 3 | 80.64 |
1557 | Minimum Number of Vertices to Reach All Nodes | Medium | Graph | 8 | 99.94 |
0841 | Keys and Rooms | Medium | Depth_First_Search, Breadth_First_Search, Graph | 3 | 51.54 |
0215 | Kth Largest Element in an Array | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Heap_Priority_Queue, Divide_and_Conquer, Quickselect, Big_O_Time_O(n*log(n))_Space_O(log(n)) | 5 | 70.82 |
0347 | Top K Frequent Elements | Medium | Top_100_Liked_Questions, Array, Hash_Table, Sorting, Heap_Priority_Queue, Counting, Divide_and_Conquer, Quickselect, Bucket_Sort, Big_O_Time_O(n*log(n))_Space_O(k) | 9 | 97.93 |
0451 | Sort Characters By Frequency | Medium | String, Hash_Table, Sorting, Heap_Priority_Queue, Counting, Bucket_Sort | 13 | 89.63 |
0973 | K Closest Points to Origin | Medium | Array, Math, Sorting, Heap_Priority_Queue, Divide_and_Conquer, Geometry, Quickselect | 4 | 98.26 |
0704 | Binary Search | Easy | Top_100_Liked_Questions, Array, Binary_Search | 0 | 100.00 |
0278 | First Bad Version | Easy | Binary_Search, Interactive | 15 | 87.89 |
0035 | Search Insert Position | Easy | Top_100_Liked_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 0 | 100.00 |
0977 | Squares of a Sorted Array | Easy | Array, Sorting, Two_Pointers | 1 | 100.00 |
0189 | Rotate Array | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Math, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 0 | 100.00 |
0283 | Move Zeroes | Easy | Top_100_Liked_Questions, Array, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 2 | 79.54 |
0167 | Two Sum II - Input Array Is Sorted | Medium | Array, Binary_Search, Two_Pointers | 1 | 99.21 |
0344 | Reverse String | Easy | String, Two_Pointers, Recursion | 1 | 99.91 |
0557 | Reverse Words in a String III | Easy | String, Two_Pointers | 4 | 97.75 |
0876 | Middle of the Linked List | Easy | Two_Pointers, Linked_List | 0 | 100.00 |
0019 | Remove Nth Node From End of List | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Two_Pointers, Linked_List, Big_O_Time_O(L)_Space_O(L) | 0 | 100.00 |
0003 | Longest Substring Without Repeating Characters | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Sliding_Window, Big_O_Time_O(n)_Space_O(1) | 2 | 99.52 |
0567 | Permutation in String | Medium | Top_100_Liked_Questions, String, Hash_Table, Two_Pointers, Sliding_Window | 5 | 93.93 |
0733 | Flood Fill | Easy | Array, Depth_First_Search, Breadth_First_Search, Matrix | 1 | 85.36 |
0695 | Max Area of Island | Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find | 3 | 76.79 |
0617 | Merge Two Binary Trees | Easy | Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 1 | 72.47 |
0116 | Populating Next Right Pointers in Each Node | Medium | Top_Interview_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Linked_List | 0 | 100.00 |
0542 | 01 Matrix | Medium | Array, Dynamic_Programming, Breadth_First_Search, Matrix | 7 | 95.83 |
0994 | Rotting Oranges | Medium | Top_100_Liked_Questions, Array, Breadth_First_Search, Matrix | 3 | 74.27 |
0021 | Merge Two Sorted Lists | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Linked_List, Recursion, Big_O_Time_O(m+n)_Space_O(m+n) | 0 | 100.00 |
0206 | Reverse Linked List | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Linked_List, Recursion, Big_O_Time_O(N)_Space_O(1) | 0 | 100.00 |
0077 | Combinations | Medium | Backtracking | 11 | 77.40 |
0046 | Permutations | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Backtracking, Big_O_Time_O(n*n!)_Space_O(n+n!) | 1 | 95.07 |
0784 | Letter Case Permutation | Medium | String, Bit_Manipulation, Backtracking | 10 | 40.38 |
0070 | Climbing Stairs | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Math, Memoization, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0198 | House Robber | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0120 | Triangle | Medium | Array, Dynamic_Programming | 2 | 94.63 |
0231 | Power of Two | Easy | Math, Bit_Manipulation, Recursion | 1 | 100.00 |
0191 | Number of 1 Bits | Easy | Top_Interview_Questions, Bit_Manipulation | 1 | 84.87 |
0190 | Reverse Bits | Easy | Top_Interview_Questions, Bit_Manipulation, Divide_and_Conquer | 1 | 98.66 |
0136 | Single Number | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Bit_Manipulation, Big_O_Time_O(N)_Space_O(1) | 1 | 99.97 |
0034 | Find First and Last Position of Element in Sorted Array | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 0 | 100.00 |
0033 | Search in Rotated Sorted Array | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 0 | 100.00 |
0074 | Search a 2D Matrix | Medium | Top_100_Liked_Questions, Array, Binary_Search, Matrix, Big_O_Time_O(endRow+endCol)_Space_O(1) | 0 | 100.00 |
0153 | Find Minimum in Rotated Sorted Array | Medium | Top_100_Liked_Questions, Array, Binary_Search, Big_O_Time_O(log_N)_Space_O(log_N) | 0 | 100.00 |
0162 | Find Peak Element | Medium | Top_Interview_Questions, Array, Binary_Search | 0 | 100.00 |
0082 | Remove Duplicates from Sorted List II | Medium | Two_Pointers, Linked_List | 0 | 100.00 |
0015 | 3Sum | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Two_Pointers, Big_O_Time_O(n*log(n))_Space_O(n^2) | 29 | 82.24 |
0844 | Backspace String Compare | Easy | String, Two_Pointers, Stack, Simulation | 0 | 100.00 |
0986 | Interval List Intersections | Medium | Array, Two_Pointers | 2 | 99.95 |
0011 | Container With Most Water | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Greedy, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 3 | 95.71 |
0438 | Find All Anagrams in a String | Medium | Top_100_Liked_Questions, String, Hash_Table, Sliding_Window, Big_O_Time_O(n+m)_Space_O(1) | 6 | 99.03 |
0713 | Subarray Product Less Than K | Medium | Array, Sliding_Window | 8 | 39.00 |
0209 | Minimum Size Subarray Sum | Medium | Array, Binary_Search, Prefix_Sum, Sliding_Window | 1 | 100.00 |
0200 | Number of Islands | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find, Big_O_Time_O(M*N)_Space_O(M*N) | 3 | 97.76 |
0547 | Number of Provinces | Medium | Depth_First_Search, Breadth_First_Search, Graph, Union_Find | 2 | 69.51 |
0117 | Populating Next Right Pointers in Each Node II | Medium | Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Linked_List | 0 | 100.00 |
0572 | Subtree of Another Tree | Easy | Depth_First_Search, Tree, Binary_Tree, Hash_Function, String_Matching | 1 | 100.00 |
1091 | Shortest Path in Binary Matrix | Medium | Array, Breadth_First_Search, Matrix | 22 | 69.99 |
0130 | Surrounded Regions | Medium | Top_Interview_Questions, Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find | 2 | 84.66 |
0797 | All Paths From Source to Target | Medium | Depth_First_Search, Breadth_First_Search, Graph, Backtracking | 2 | 90.53 |
0078 | Subsets | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Bit_Manipulation, Backtracking, Big_O_Time_O(2^n)_Space_O(n*2^n) | 1 | 70.60 |
0090 | Subsets II | Medium | Array, Bit_Manipulation, Backtracking | 2 | 82.94 |
0047 | Permutations II | Medium | Array, Backtracking | 1 | 99.86 |
0039 | Combination Sum | Medium | Top_100_Liked_Questions, Array, Backtracking, Big_O_Time_O(2^n)_Space_O(n+2^n) | 1 | 100.00 |
0040 | Combination Sum II | Medium | Array, Backtracking | 2 | 99.75 |
0017 | Letter Combinations of a Phone Number | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Backtracking, Big_O_Time_O(4^n)_Space_O(n) | 0 | 100.00 |
0022 | Generate Parentheses | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Backtracking, Big_O_Time_O(2^n)_Space_O(n) | 0 | 100.00 |
0079 | Word Search | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Matrix, Backtracking, Big_O_Time_O(4^(m*n))_Space_O(m*n) | 157 | 78.97 |
0213 | House Robber II | Medium | Array, Dynamic_Programming | 0 | 100.00 |
0055 | Jump Game | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Greedy, Big_O_Time_O(n)_Space_O(1) | 2 | 79.47 |
0045 | Jump Game II | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Greedy, Big_O_Time_O(n)_Space_O(1) | 2 | 49.02 |
0062 | Unique Paths | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Math, Combinatorics, Big_O_Time_O(m*n)_Space_O(m*n) | 0 | 100.00 |
0005 | Longest Palindromic Substring | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 7 | 96.96 |
0413 | Arithmetic Slices | Medium | Array, Dynamic_Programming | 0 | 100.00 |
0091 | Decode Ways | Medium | Top_Interview_Questions, String, Dynamic_Programming | 2 | 66.37 |
0139 | Word Break | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Dynamic_Programming, Trie, Memoization, Big_O_Time_O(M+max*N)_Space_O(M+N+max) | 2 | 97.08 |
0300 | Longest Increasing Subsequence | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Binary_Search, Big_O_Time_O(n*log_n)_Space_O(n) | 3 | 98.63 |
0673 | Number of Longest Increasing Subsequence | Medium | Array, Dynamic_Programming, Segment_Tree, Binary_Indexed_Tree | 25 | 68.75 |
1143 | Longest Common Subsequence | Medium | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n*m)_Space_O(n*m) | 33 | 46.23 |
0583 | Delete Operation for Two Strings | Medium | String, Dynamic_Programming | 12 | 79.10 |
0072 | Edit Distance | Medium | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n^2)_Space_O(n2) | 4 | 90.13 |
0322 | Coin Change | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Breadth_First_Search, Big_O_Time_O(m*n)_Space_O(amount) | 17 | 91.77 |
0343 | Integer Break | Medium | Dynamic_Programming, Math | 0 | 100.00 |
0201 | Bitwise AND of Numbers Range | Medium | Bit_Manipulation | 8 | 74.15 |
0384 | Shuffle an Array | Medium | Array, Math, Randomized | 52 | 91.77 |
0202 | Happy Number | Easy | Top_Interview_Questions, Hash_Table, Math, Two_Pointers | 1 | 98.59 |
0149 | Max Points on a Line | Hard | Top_Interview_Questions, Array, Hash_Table, Math, Geometry | 11 | 99.21 |
0704 | Binary Search | Easy | Top_100_Liked_Questions, Array, Binary_Search | 0 | 100.00 |
0374 | Guess Number Higher or Lower | Easy | Binary_Search, Interactive | 0 | 100.00 |
0035 | Search Insert Position | Easy | Top_100_Liked_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 0 | 100.00 |
0852 | Peak Index in a Mountain Array | Medium | Array, Binary_Search | 0 | 100.00 |
0367 | Valid Perfect Square | Easy | Math, Binary_Search | 0 | 100.00 |
1385 | Find the Distance Value Between Two Arrays | Easy | Array, Sorting, Binary_Search, Two_Pointers | 5 | 65.78 |
0069 | Sqrt(x) | Easy | Top_Interview_Questions, Math, Binary_Search | 1 | 99.51 |
0744 | Find Smallest Letter Greater Than Target | Easy | Array, Binary_Search | 0 | 100.00 |
0278 | First Bad Version | Easy | Binary_Search, Interactive | 15 | 87.89 |
0034 | Find First and Last Position of Element in Sorted Array | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 0 | 100.00 |
0441 | Arranging Coins | Easy | Math, Binary_Search | 2 | 95.97 |
1539 | Kth Missing Positive Number | Easy | Array, Binary_Search | 0 | 100.00 |
0167 | Two Sum II - Input Array Is Sorted | Medium | Array, Binary_Search, Two_Pointers | 1 | 99.21 |
1608 | Special Array With X Elements Greater Than or Equal X | Easy | Array, Sorting, Binary_Search | 2 | 61.14 |
1351 | Count Negative Numbers in a Sorted Matrix | Easy | Array, Binary_Search, Matrix | 1 | 49.66 |
0074 | Search a 2D Matrix | Medium | Top_100_Liked_Questions, Array, Binary_Search, Matrix, Big_O_Time_O(endRow+endCol)_Space_O(1) | 0 | 100.00 |
1337 | The K Weakest Rows in a Matrix | Easy | Array, Sorting, Binary_Search, Matrix, Heap_Priority_Queue | 1 | 99.77 |
1346 | Check If N and Its Double Exist | Easy | Array, Hash_Table, Sorting, Binary_Search, Two_Pointers | 1 | 99.64 |
0350 | Intersection of Two Arrays II | Easy | Array, Hash_Table, Sorting, Binary_Search, Two_Pointers | 4 | 69.62 |
0633 | Sum of Square Numbers | Medium | Math, Binary_Search, Two_Pointers | 4 | 82.92 |
1855 | Maximum Distance Between a Pair of Values | Medium | Array, Greedy, Binary_Search, Two_Pointers | 4 | 62.20 |
0033 | Search in Rotated Sorted Array | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 0 | 100.00 |
0153 | Find Minimum in Rotated Sorted Array | Medium | Top_100_Liked_Questions, Array, Binary_Search, Big_O_Time_O(log_N)_Space_O(log_N) | 0 | 100.00 |
0209 | Minimum Size Subarray Sum | Medium | Array, Binary_Search, Prefix_Sum, Sliding_Window | 1 | 100.00 |
0611 | Valid Triangle Number | Medium | Array, Sorting, Greedy, Binary_Search, Two_Pointers | 10 | 100.00 |
0658 | Find K Closest Elements | Medium | Array, Sorting, Binary_Search, Two_Pointers, Heap_Priority_Queue | 3 | 99.20 |
1894 | Find the Student that Will Replace the Chalk | Medium | Array, Binary_Search, Simulation, Prefix_Sum | 2 | 76.67 |
0300 | Longest Increasing Subsequence | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Binary_Search, Big_O_Time_O(n*log_n)_Space_O(n) | 3 | 98.63 |
1760 | Minimum Limit of Balls in a Bag | Medium | Array, Binary_Search | 44 | 78.49 |
0875 | Koko Eating Bananas | Medium | Array, Binary_Search | 15 | 91.32 |
1552 | Magnetic Force Between Two Balls | Medium | Array, Sorting, Binary_Search | 39 | 99.65 |
0287 | Find the Duplicate Number | Medium | Top_100_Liked_Questions, Array, Binary_Search, Two_Pointers, Bit_Manipulation, Big_O_Time_O(n)_Space_O(n) | 2 | 99.82 |
1283 | Find the Smallest Divisor Given a Threshold | Medium | Array, Binary_Search | 9 | 95.49 |
1898 | Maximum Number of Removable Characters | Medium | Array, String, Binary_Search | 121 | 72.51 |
1870 | Minimum Speed to Arrive on Time | Medium | Array, Binary_Search | 86 | 88.58 |
1482 | Minimum Number of Days to Make m Bouquets | Medium | Array, Binary_Search | 25 | 69.18 |
1818 | Minimum Absolute Sum Difference | Medium | Array, Sorting, Binary_Search, Ordered_Set | 13 | 99.44 |
0240 | Search a 2D Matrix II | Medium | Top_100_Liked_Questions, Array, Binary_Search, Matrix, Divide_and_Conquer, Big_O_Time_O(n+m)_Space_O(1) | 7 | 86.73 |
0275 | H-Index II | Medium | Array, Binary_Search | 0 | 100.00 |
1838 | Frequency of the Most Frequent Element | Medium | Array, Sorting, Greedy, Binary_Search, Prefix_Sum, Sliding_Window | 11 | 100.00 |
0540 | Single Element in a Sorted Array | Medium | Array, Binary_Search | 0 | 100.00 |
0222 | Count Complete Tree Nodes | Easy | Depth_First_Search, Tree, Binary_Search, Binary_Tree | 0 | 100.00 |
1712 | Ways to Split Array Into Three Subarrays | Medium | Array, Binary_Search, Two_Pointers, Prefix_Sum | 16 | 84.24 |
0826 | Most Profit Assigning Work | Medium | Array, Sorting, Greedy, Binary_Search, Two_Pointers | 21 | 83.83 |
0436 | Find Right Interval | Medium | Array, Sorting, Binary_Search | 20 | 81.51 |
0081 | Search in Rotated Sorted Array II | Medium | Array, Binary_Search | 1 | 82.83 |
0162 | Find Peak Element | Medium | Top_Interview_Questions, Array, Binary_Search | 0 | 100.00 |
0154 | Find Minimum in Rotated Sorted Array II | Hard | Array, Binary_Search | 1 | 77.09 |
0528 | Random Pick with Weight | Medium | Math, Binary_Search, Prefix_Sum, Randomized | 42 | 50.90 |
1508 | Range Sum of Sorted Subarray Sums | Medium | Array, Sorting, Binary_Search, Two_Pointers | 60 | 93.84 |
1574 | Shortest Subarray to be Removed to Make Array Sorted | Medium | Array, Binary_Search, Two_Pointers, Stack, Monotonic_Stack | 2 | 84.97 |
1292 | Maximum Side Length of a Square with Sum Less than or Equal to Threshold | Medium | Array, Binary_Search, Matrix, Prefix_Sum | 23 | 32.97 |
1498 | Number of Subsequences That Satisfy the Given Sum Condition | Medium | Array, Sorting, Binary_Search, Two_Pointers | 27 | 99.13 |
0981 | Time Based Key-Value Store | Medium | String, Hash_Table, Binary_Search, Design | 239 | 72.78 |
1300 | Sum of Mutated Array Closest to Target | Medium | Array, Sorting, Binary_Search | 7 | 33.33 |
1802 | Maximum Value at a Given Index in a Bounded Array | Medium | Greedy, Binary_Search | 2 | 58.44 |
1901 | Find a Peak Element II | Medium | Array, Binary_Search, Matrix, Divide_and_Conquer | 0 | 100.00 |
1146 | Snapshot Array | Medium | Array, Hash_Table, Binary_Search, Design | 68 | 45.86 |
1488 | Avoid Flood in The City | Medium | Array, Hash_Table, Greedy, Binary_Search, Heap_Priority_Queue | 82 | 75.08 |
1562 | Find Latest Group of Size M | Medium | Array, Binary_Search, Simulation | 8 | 90.00 |
1648 | Sell Diminishing-Valued Colored Balls | Medium | Array, Math, Sorting, Greedy, Binary_Search, Heap_Priority_Queue | 27 | 80.64 |
1201 | Ugly Number III | Medium | Math, Binary_Search, Number_Theory | 0 | 100.00 |
0911 | Online Election | Medium | Array, Hash_Table, Binary_Search, Design | 63 | 98.81 |
0509 | Fibonacci Number | Easy | Dynamic_Programming, Math, Recursion, Memoization | 0 | 100.00 |
1137 | N-th Tribonacci Number | Easy | Dynamic_Programming, Math, Memoization | 0 | 100.00 |
0070 | Climbing Stairs | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Math, Memoization, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0746 | Min Cost Climbing Stairs | Easy | Array, Dynamic_Programming | 1 | 86.38 |
0198 | House Robber | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0213 | House Robber II | Medium | Array, Dynamic_Programming | 0 | 100.00 |
0740 | Delete and Earn | Medium | Array, Hash_Table, Dynamic_Programming | 4 | 77.68 |
0055 | Jump Game | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Greedy, Big_O_Time_O(n)_Space_O(1) | 2 | 79.47 |
0045 | Jump Game II | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Greedy, Big_O_Time_O(n)_Space_O(1) | 2 | 49.02 |
0053 | Maximum Subarray | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Divide_and_Conquer, Big_O_Time_O(n)_Space_O(1) | 1 | 100.00 |
0918 | Maximum Sum Circular Subarray | Medium | Array, Dynamic_Programming, Divide_and_Conquer, Queue, Monotonic_Queue | 3 | 92.86 |
0152 | Maximum Product Subarray | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(N)_Space_O(1) | 1 | 92.31 |
1567 | Maximum Length of Subarray With Positive Product | Medium | Array, Dynamic_Programming, Greedy | 4 | 80.86 |
1014 | Best Sightseeing Pair | Medium | Array, Dynamic_Programming | 2 | 99.86 |
0121 | Best Time to Buy and Sell Stock | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(N)_Space_O(1) | 1 | 100.00 |
0122 | Best Time to Buy and Sell Stock II | Medium | Top_Interview_Questions, Array, Dynamic_Programming, Greedy | 1 | 96.82 |
0309 | Best Time to Buy and Sell Stock with Cooldown | Medium | Array, Dynamic_Programming | 0 | 100.00 |
0714 | Best Time to Buy and Sell Stock with Transaction Fee | Medium | Array, Dynamic_Programming, Greedy | 4 | 78.57 |
0139 | Word Break | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Dynamic_Programming, Trie, Memoization, Big_O_Time_O(M+max*N)_Space_O(M+N+max) | 2 | 97.08 |
0042 | Trapping Rain Water | Hard | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Two_Pointers, Stack, Monotonic_Stack, Big_O_Time_O(n)_Space_O(1) | 0 | 100.00 |
0413 | Arithmetic Slices | Medium | Array, Dynamic_Programming | 0 | 100.00 |
0091 | Decode Ways | Medium | Top_Interview_Questions, String, Dynamic_Programming | 2 | 66.37 |
0264 | Ugly Number II | Medium | Hash_Table, Dynamic_Programming, Math, Heap_Priority_Queue | 2 | 99.91 |
0096 | Unique Binary Search Trees | Medium | Dynamic_Programming, Math, Tree, Binary_Tree, Binary_Search_Tree, Big_O_Time_O(n)_Space_O(1) | 0 | 100.00 |
0118 | Pascal's Triangle | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming | 1 | 67.08 |
0119 | Pascal's Triangle II | Easy | Array, Dynamic_Programming | 0 | 100.00 |
0931 | Minimum Falling Path Sum | Medium | Array, Dynamic_Programming, Matrix | 4 | 72.19 |
0120 | Triangle | Medium | Array, Dynamic_Programming | 2 | 94.63 |
1314 | Matrix Block Sum | Medium | Array, Matrix, Prefix_Sum | 5 | 67.46 |
0304 | Range Sum Query 2D - Immutable | Medium | Array, Matrix, Design, Prefix_Sum | 153 | 87.51 |
0062 | Unique Paths | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Math, Combinatorics, Big_O_Time_O(m*n)_Space_O(m*n) | 0 | 100.00 |
0063 | Unique Paths II | Medium | Array, Dynamic_Programming, Matrix | 0 | 100.00 |
0064 | Minimum Path Sum | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Matrix, Big_O_Time_O(m*n)_Space_O(m*n) | 0 | 100.00 |
0221 | Maximal Square | Medium | Array, Dynamic_Programming, Matrix, Big_O_Time_O(m*n)_Space_O(m*n) | 7 | 72.35 |
0005 | Longest Palindromic Substring | Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 7 | 96.96 |
0516 | Longest Palindromic Subsequence | Medium | String, Dynamic_Programming | 88 | 58.87 |
0300 | Longest Increasing Subsequence | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Binary_Search, Big_O_Time_O(n*log_n)_Space_O(n) | 3 | 98.63 |
0376 | Wiggle Subsequence | Medium | Array, Dynamic_Programming, Greedy | 0 | 100.00 |
0392 | Is Subsequence | Easy | String, Dynamic_Programming, Two_Pointers | 1 | 93.01 |
1143 | Longest Common Subsequence | Medium | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n*m)_Space_O(n*m) | 33 | 46.23 |
0072 | Edit Distance | Medium | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n^2)_Space_O(n2) | 4 | 90.13 |
0322 | Coin Change | Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Breadth_First_Search, Big_O_Time_O(m*n)_Space_O(amount) | 17 | 91.77 |
0518 | Coin Change 2 | Medium | Array, Dynamic_Programming | 4 | 84.67 |
0377 | Combination Sum IV | Medium | Array, Dynamic_Programming | 1 | 92.54 |
0343 | Integer Break | Medium | Dynamic_Programming, Math | 0 | 100.00 |
0279 | Perfect Squares | Medium | Dynamic_Programming, Math, Breadth_First_Search | 1 | 100.00 |
1523 | Count Odd Numbers in an Interval Range | Easy | Math | 0 | 100.00 |
1491 | Average Salary Excluding the Minimum and Maximum Salary | Easy | Array, Sorting | 0 | 100.00 |
0191 | Number of 1 Bits | Easy | Top_Interview_Questions, Bit_Manipulation | 1 | 84.87 |
1281 | Subtract the Product and Sum of Digits of an Integer | Easy | Math | 0 | 100.00 |
0976 | Largest Perimeter Triangle | Easy | Array, Math, Sorting, Greedy | 12 | 26.01 |
1779 | Find Nearest Point That Has the Same X or Y Coordinate | Easy | Array | 1 | 100.00 |
1822 | Sign of the Product of an Array | Easy | Array, Math | 1 | 58.05 |
1502 | Can Make Arithmetic Progression From Sequence | Easy | Array, Sorting | 2 | 90.55 |
0202 | Happy Number | Easy | Top_Interview_Questions, Hash_Table, Math, Two_Pointers | 1 | 98.59 |
1790 | Check if One String Swap Can Make Strings Equal | Easy | String, Hash_Table, Counting | 0 | 100.00 |
0589 | N-ary Tree Preorder Traversal | Easy | Depth_First_Search, Tree, Stack | 1 | 90.98 |
0496 | Next Greater Element I | Easy | Array, Hash_Table, Stack, Monotonic_Stack | 4 | 81.18 |
1232 | Check If It Is a Straight Line | Easy | Array, Math, Geometry | 0 | 100.00 |
1588 | Sum of All Odd Length Subarrays | Easy | Array, Math, Prefix_Sum | 0 | 100.00 |
0283 | Move Zeroes | Easy | Top_100_Liked_Questions, Array, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 2 | 79.54 |
1672 | Richest Customer Wealth | Easy | Array, Matrix | 0 | 100.00 |
1572 | Matrix Diagonal Sum | Easy | Array, Matrix | 0 | 100.00 |
0566 | Reshape the Matrix | Easy | Array, Matrix, Simulation | 1 | 90.08 |
1768 | Merge Strings Alternately | Easy | String, Two_Pointers | 1 | 86.26 |
1678 | Goal Parser Interpretation | Easy | String | 0 | 100.00 |
0389 | Find the Difference | Easy | String, Hash_Table, Sorting, Bit_Manipulation | 1 | 100.00 |
0709 | To Lower Case | Easy | String | 1 | 71.74 |
1309 | Decrypt String from Alphabet to Integer Mapping | Easy | String | 6 | 28.25 |
0953 | Verifying an Alien Dictionary | Easy | Array, String, Hash_Table | 0 | 100.00 |
1290 | Convert Binary Number in a Linked List to Integer | Easy | Math, Linked_List | 0 | 100.00 |
0876 | Middle of the Linked List | Easy | Two_Pointers, Linked_List | 0 | 100.00 |
0104 | Maximum Depth of Binary Tree | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(H) | 0 | 100.00 |
0404 | Sum of Left Leaves | Easy | Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 1 | 29.26 |
1356 | Sort Integers by The Number of 1 Bits | Easy | Array, Sorting, Bit_Manipulation, Counting | 10 | 65.50 |
0232 | Implement Queue using Stacks | Easy | Stack, Design, Queue | 1 | 67.21 |
0242 | Valid Anagram | Easy | String, Hash_Table, Sorting | 2 | 99.01 |
0217 | Contains Duplicate | Easy | Top_Interview_Questions, Array, Hash_Table, Sorting | 6 | 96.68 |
1603 | Design Parking System | Easy | Design, Simulation, Counting | 8 | 76.16 |
0303 | Range Sum Query - Immutable | Easy | Array, Design, Prefix_Sum | 7 | 100.00 |
0896 | Monotonic Array | Easy | Array | 2 | 86.21 |
0028 | Implement strStr() | Easy | Top_Interview_Questions, String, Two_Pointers, String_Matching | 0 | 100.00 |
0110 | Balanced Binary Tree | Easy | Depth_First_Search, Tree, Binary_Tree | 1 | 98.82 |
0459 | Repeated Substring Pattern | Easy | String, String_Matching | 8 | 96.64 |
0150 | Evaluate Reverse Polish Notation | Medium | Top_Interview_Questions, Array, Math, Stack | 9 | 51.23 |
0066 | Plus One | Easy | Top_Interview_Questions, Array, Math | 0 | 100.00 |
1367 | Linked List in Binary Tree | Medium | Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree, Linked_List | 2 | 61.23 |
0043 | Multiply Strings | Medium | String, Math, Simulation | 1 | 100.00 |
0067 | Add Binary | Easy | String, Math, Bit_Manipulation, Simulation | 1 | 100.00 |
0989 | Add to Array-Form of Integer | Easy | Array, Math | 7 | 65.92 |
0739 | Daily Temperatures | Medium | Top_100_Liked_Questions, Array, Stack, Monotonic_Stack, Big_O_Time_O(n)_Space_O(n) | 10 | 94.99 |
0058 | Length of Last Word | Easy | String | 0 | 100.00 |
0048 | Rotate Image | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Math, Matrix, Big_O_Time_O(n^2)_Space_O(1) | 0 | 100.00 |
1886 | Determine Whether Matrix Can Be Obtained By Rotation | Easy | Array, Matrix | 1 | 78.38 |
0054 | Spiral Matrix | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Matrix, Simulation | 0 | 100.00 |
0973 | K Closest Points to Origin | Medium | Array, Math, Sorting, Heap_Priority_Queue, Divide_and_Conquer, Geometry, Quickselect | 4 | 98.26 |
1630 | Arithmetic Subarrays | Medium | Array, Sorting | 8 | 93.62 |
0429 | N-ary Tree Level Order Traversal | Medium | Breadth_First_Search, Tree | 3 | 80.26 |
0503 | Next Greater Element II | Medium | Array, Stack, Monotonic_Stack | 7 | 97.03 |
0556 | Next Greater Element III | Medium | String, Math, Two_Pointers | 0 | 100.00 |
1376 | Time Needed to Inform All Employees | Medium | Depth_First_Search, Breadth_First_Search, Tree | 8 | 99.85 |
0049 | Group Anagrams | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, String, Hash_Table, Sorting, Big_O_Time_O(n*k_log_k)_Space_O(n) | 6 | 92.28 |
0438 | Find All Anagrams in a String | Medium | Top_100_Liked_Questions, String, Hash_Table, Sliding_Window, Big_O_Time_O(n+m)_Space_O(1) | 6 | 99.03 |
0713 | Subarray Product Less Than K | Medium | Array, Sliding_Window | 8 | 39.00 |
0304 | Range Sum Query 2D - Immutable | Medium | Array, Matrix, Design, Prefix_Sum | 153 | 87.51 |
0910 | Smallest Range II | Medium | Array, Math, Sorting, Greedy | 10 | 73.16 |
0143 | Reorder List | Medium | Two_Pointers, Stack, Linked_List, Recursion | 2 | 72.59 |
0138 | Copy List with Random Pointer | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Hash_Table, Linked_List, Big_O_Time_O(N)_Space_O(N) | 0 | 100.00 |
0002 | Add Two Numbers | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Math, Linked_List, Recursion, Big_O_Time_O(max(N,M))_Space_O(max(N,M)) | 1 | 100.00 |
0445 | Add Two Numbers II | Medium | Math, Stack, Linked_List | 3 | 90.38 |
0061 | Rotate List | Medium | Two_Pointers, Linked_List | 0 | 100.00 |
0173 | Binary Search Tree Iterator | Medium | Tree, Binary_Tree, Stack, Design, Binary_Search_Tree, Iterator | 18 | 84.18 |
1845 | Seat Reservation Manager | Medium | Design, Heap_Priority_Queue | 47 | 87.63 |
0860 | Lemonade Change | Easy | Array, Greedy | 2 | 90.84 |
0155 | Min Stack | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Stack, Design, Big_O_Time_O(1)_Space_O(N) | 3 | 100.00 |
0341 | Flatten Nested List Iterator | Medium | Depth_First_Search, Tree, Stack, Design, Queue, Iterator | 2 | 99.95 |
1797 | Design Authentication Manager | Medium | Hash_Table, Design | 41 | 92.67 |
0707 | Design Linked List | Medium | Design, Linked_List | 10 | 70.60 |
0380 | Insert Delete GetRandom O(1) | Medium | Array, Hash_Table, Math, Design, Randomized | 27 | 93.44 |
0622 | Design Circular Queue | Medium | Array, Design, Linked_List, Queue | 3 | 100.00 |
0729 | My Calendar I | Medium | Binary_Search, Design, Ordered_Set, Segment_Tree | 17 | 97.23 |
0733 | Flood Fill | Easy | Array, Depth_First_Search, Breadth_First_Search, Matrix | 1 | 85.36 |
0200 | Number of Islands | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find, Big_O_Time_O(M*N)_Space_O(M*N) | 3 | 97.76 |
0695 | Max Area of Island | Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find | 3 | 76.79 |
1254 | Number of Closed Islands | Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find | 3 | 55.59 |
1020 | Number of Enclaves | Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find | 6 | 68.24 |
1905 | Count Sub Islands | Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find | 24 | 85.54 |
1162 | As Far from Land as Possible | Medium | Array, Dynamic_Programming, Breadth_First_Search, Matrix | 16 | 62.40 |
0417 | Pacific Atlantic Water Flow | Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix | 5 | 92.62 |
1091 | Shortest Path in Binary Matrix | Medium | Array, Breadth_First_Search, Matrix | 22 | 69.99 |
0542 | 01 Matrix | Medium | Array, Dynamic_Programming, Breadth_First_Search, Matrix | 7 | 95.83 |
0934 | Shortest Bridge | Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix | 6 | 97.87 |
1926 | Nearest Exit from Entrance in Maze | Medium | Array, Breadth_First_Search, Matrix | 12 | 40.55 |
0797 | All Paths From Source to Target | Medium | Depth_First_Search, Breadth_First_Search, Graph, Backtracking | 2 | 90.53 |
0841 | Keys and Rooms | Medium | Depth_First_Search, Breadth_First_Search, Graph | 3 | 51.54 |
0547 | Number of Provinces | Medium | Depth_First_Search, Breadth_First_Search, Graph, Union_Find | 2 | 69.51 |
1319 | Number of Operations to Make Network Connected | Medium | Depth_First_Search, Breadth_First_Search, Graph, Union_Find | 9 | 67.64 |
1376 | Time Needed to Inform All Employees | Medium | Depth_First_Search, Breadth_First_Search, Tree | 8 | 99.85 |
0802 | Find Eventual Safe States | Medium | Depth_First_Search, Breadth_First_Search, Graph, Topological_Sort | 7 | 74.93 |
1129 | Shortest Path with Alternating Colors | Medium | Breadth_First_Search, Graph | 4 | 96.63 |
1466 | Reorder Routes to Make All Paths Lead to the City Zero | Medium | Depth_First_Search, Breadth_First_Search, Graph | 39 | 97.71 |
0847 | Shortest Path Visiting All Nodes | Hard | Dynamic_Programming, Breadth_First_Search, Bit_Manipulation, Graph, Bitmask | 14 | 78.72 |
1306 | Jump Game III | Medium | Array, Depth_First_Search, Breadth_First_Search | 2 | 96.23 |
1654 | Minimum Jumps to Reach Home | Medium | Array, Dynamic_Programming, Breadth_First_Search | 6 | 99.87 |
0365 | Water and Jug Problem | Medium | Math, Depth_First_Search, Breadth_First_Search | 0 | 100.00 |
0433 | Minimum Genetic Mutation | Medium | String, Hash_Table, Breadth_First_Search | 1 | 90.95 |
0752 | Open the Lock | Medium | Array, String, Hash_Table, Breadth_First_Search | 72 | 91.06 |
0127 | Word Ladder | Hard | Top_Interview_Questions, String, Hash_Table, Breadth_First_Search | 37 | 94.58 |
0997 | Find the Town Judge | Easy | Array, Hash_Table, Graph | 3 | 80.64 |
1557 | Minimum Number of Vertices to Reach All Nodes | Medium | Graph | 8 | 99.94 |
1615 | Maximal Network Rank | Medium | Graph | 3 | 97.34 |
0886 | Possible Bipartition | Medium | Depth_First_Search, Breadth_First_Search, Graph, Union_Find | 20 | 80.12 |
0785 | Is Graph Bipartite? | Medium | Depth_First_Search, Breadth_First_Search, Graph, Union_Find | 0 | 100.00 |
0595 | Big Countries | Easy | Database | 262 | 84.64 |
1757 | Recyclable and Low Fat Products | Easy | Database | 475 | 71.54 |
0584 | Find Customer Referee | Easy | Database | 531 | 58.63 |
0183 | Customers Who Never Order | Easy | Database | 376 | 98.73 |
1873 | Calculate Special Bonus | Easy | Database | 543 | 71.60 |
0627 | Swap Salary | Easy | Database | 191 | 96.89 |
0196 | Delete Duplicate Emails | Easy | Database | 903 | 48.10 |
1667 | Fix Names in a Table | Easy | Database | 559 | 80.29 |
1484 | Group Sold Products By The Date | Easy | LeetCode_Curated_SQL_70, Database | 395 | 77.20 |
1527 | Patients With a Condition | Easy | Database | 308 | 66.93 |
1965 | Employees With Missing Information | Easy | Database | 617 | 30.40 |
1795 | Rearrange Products Table | Easy | Database | 497 | 64.83 |
0608 | Tree Node | Medium | LeetCode_Curated_SQL_70, Database | 347 | 95.17 |
0176 | Second Highest Salary | Medium | Database | 225 | 73.10 |
0175 | Combine Two Tables | Easy | Database | 491 | 32.30 |
1581 | Customer Who Visited but Did Not Make Any Transactions | Easy | Database | 1039 | 76.99 |
1148 | Article Views I | Easy | LeetCode_Curated_SQL_70, Database | 783 | 64.09 |
0197 | Rising Temperature | Easy | Database | 342 | 93.76 |
0607 | Sales Person | Easy | LeetCode_Curated_SQL_70, Database | 1046 | 86.04 |
1141 | User Activity for the Past 30 Days I | Easy | LeetCode_Curated_SQL_70, Database | 849 | 72.54 |
1693 | Daily Leads and Partners | Easy | Database | 463 | 78.98 |
1729 | Find Followers Count | Easy | Database | 456 | 88.39 |
0586 | Customer Placing the Largest Number of Orders | Easy | LeetCode_Curated_SQL_70, Database | 484 | 66.42 |
0511 | Game Play Analysis I | Easy | LeetCode_Curated_SQL_70, Database | 586 | 56.94 |
1890 | The Latest Login in 2020 | Easy | Database | 571 | 73.59 |
1741 | Find Total Time Spent by Each Employee | Easy | Database | 414 | 93.27 |
1393 | Capital Gain/Loss | Medium | LeetCode_Curated_SQL_70, Database | 428 | 92.01 |
1407 | Top Travellers | Easy | LeetCode_Curated_SQL_70, Database | 682 | 70.16 |
1158 | Market Analysis I | Medium | Database | 2511 | 78.92 |
0182 | Duplicate Emails | Easy | Database | 303 | 92.08 |
1050 | Actors and Directors Who Cooperated At Least Three Times | Easy | LeetCode_Curated_SQL_70, Database | 344 | 76.48 |
1587 | Bank Account Summary II | Easy | Database | 630 | 60.32 |
1084 | Sales Analysis III | Easy | LeetCode_Curated_SQL_70, Database | 1066 | 69.71 |
1480 | Running Sum of 1d Array | Easy | Array, Prefix_Sum | 0 | 100.00 |
0724 | Find Pivot Index | Easy | Array, Prefix_Sum | 2 | 69.67 |
0205 | Isomorphic Strings | Easy | String, Hash_Table | 2 | 99.97 |
0392 | Is Subsequence | Easy | String, Dynamic_Programming, Two_Pointers | 1 | 93.01 |
0021 | Merge Two Sorted Lists | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Linked_List, Recursion, Big_O_Time_O(m+n)_Space_O(m+n) | 0 | 100.00 |
0206 | Reverse Linked List | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Linked_List, Recursion, Big_O_Time_O(N)_Space_O(1) | 0 | 100.00 |
0876 | Middle of the Linked List | Easy | Two_Pointers, Linked_List | 0 | 100.00 |
0142 | Linked List Cycle II | Medium | Top_100_Liked_Questions, Hash_Table, Two_Pointers, Linked_List, Big_O_Time_O(N)_Space_O(1) | 0 | 100.00 |
0121 | Best Time to Buy and Sell Stock | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Big_O_Time_O(N)_Space_O(1) | 1 | 100.00 |
0409 | Longest Palindrome | Easy | String, Hash_Table, Greedy | 2 | 92.90 |
0589 | N-ary Tree Preorder Traversal | Easy | Depth_First_Search, Tree, Stack | 1 | 90.98 |
0102 | Binary Tree Level Order Traversal | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(N) | 1 | 91.09 |
0704 | Binary Search | Easy | Top_100_Liked_Questions, Array, Binary_Search | 0 | 100.00 |
0278 | First Bad Version | Easy | Binary_Search, Interactive | 15 | 87.89 |
0098 | Validate Binary Search Tree | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Depth_First_Search, Tree, Binary_Tree, Binary_Search_Tree, Big_O_Time_O(N)_Space_O(log(N)) | 0 | 100.00 |
0235 | Lowest Common Ancestor of a Binary Search Tree | Medium | Depth_First_Search, Tree, Binary_Tree, Binary_Search_Tree | 4 | 100.00 |
0733 | Flood Fill | Easy | Array, Depth_First_Search, Breadth_First_Search, Matrix | 1 | 85.36 |
0200 | Number of Islands | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find, Big_O_Time_O(M*N)_Space_O(M*N) | 3 | 97.76 |
0509 | Fibonacci Number | Easy | Dynamic_Programming, Math, Recursion, Memoization | 0 | 100.00 |
0070 | Climbing Stairs | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Math, Memoization, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00 |
0746 | Min Cost Climbing Stairs | Easy | Array, Dynamic_Programming | 1 | 86.38 |
0062 | Unique Paths | Medium | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Math, Combinatorics, Big_O_Time_O(m*n)_Space_O(m*n) | 0 | 100.00 |
0438 | Find All Anagrams in a String | Medium | Top_100_Liked_Questions, String, Hash_Table, Sliding_Window, Big_O_Time_O(n+m)_Space_O(1) | 6 | 99.03 |
0424 | Longest Repeating Character Replacement | Medium | String, Hash_Table, Sliding_Window | 5 | 95.15 |
0001 | Two Sum | Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Hash_Table, Big_O_Time_O(n)_Space_O(n) | 2 | 85.97 |
0299 | Bulls and Cows | Medium | String, Hash_Table, Counting | 6 | 86.69 |
0844 | Backspace String Compare | Easy | String, Two_Pointers, Stack, Simulation | 0 | 100.00 |
0394 | Decode String | Medium | Top_100_Liked_Questions, String, Stack, Recursion, Big_O_Time_O(n)_Space_O(n) | 1 | 87.68 |
1046 | Last Stone Weight | Easy | Array, Heap_Priority_Queue | 2 | 73.81 |
0692 | Top K Frequent Words | Medium | String, Hash_Table, Sorting, Heap_Priority_Queue, Counting, Trie, Bucket_Sort | 11 | 38.54 |
Your ideas/fixes/algorithms are more than welcome!
- Fork this repo
- Clone your forked repo (
git clone https://github.com/YOUR_GITHUB_USERNAME/LeetCode-in-Java.git
) onto your local machine cd
into your cloned directory, create your feature branch (git checkout -b my-awesome-fix
)git add
your desired changes to this repo- Commit your changes (
git commit -m 'Added some awesome features/fixes'
) - Push to the branch (
git push origin my-awesome-feature
) - Open your forked repo on Github website, create a new Pull Request to this repo!