Collection of LeetCode questions to ace the coding interview!
# | Title | Topic | Cost | Memory | Solution | Difficulty |
---|---|---|---|---|---|---|
1 | Two Sum | Array | - | - | Java | Easy |
5 | Longest Palindromic Substring | String | O(n^3) | O(1) | Java | Medium |
7 | Reverse Integer | Math | - | - | Java | Medium |
14 | Longest Common Prefix | String | - | - | Java | Easy |
15 | 3Sum | Array | O(n^2) | O(n^2) | Java | Medium |
19 | Remove Nth Node From End of List | Linked List | - | - | Java | Medium |
20 | Valid Parentheses | String | - | - | Java | Easy |
21 | Merge Two Sorted Lists | Linked List | - | - | Java | Easy |
26 | Remove Duplicates from Sorted Array | Array | - | - | Java | Easy |
38 | Count and Say | String | O(nm) | O(1) | Java | Medium |
49 | Group Anagrams | String | O(n^2logn) | O(n) | Java | Medium |
50 | Pow(x, n) | Math | O(n) | O(1) | Java | Medium |
53 | Maximum Subarray | Array | - | - | Java | Easy |
66 | Plus One | Math | - | - | Java | Easy |
70 | Climbing Stairs | Math | - | - | Java | Easy |
73 | Set Matrix Zeroes | Matrix | O(n^2) | O(n) | Java | Medium |
88 | Merge Sorted Array | Sorting | - | - | Java | Easy |
122 | Best Time to Buy and Sell Stock II | Greedy | - | - | Java | Medium |
125 | Valid Palindrome | String | - | - | Java | Easy |
136 | Single NumberEasy | Array | - | - | Java | Easy |
141 | Linked List Cycle | Linked List | - | - | Java | Easy |
155 | Min Stack | Stack | - | - | Java | Easy |
169 | Majority Element | Array | O(nlogn) | O(1) | Java | Easy |
172 | Factorial Trailing Zeroes | Math | O(n) | O(1) | Java | Medium |
189 | Rotate Array | Array | - | - | Java | Medium |
191 | Number of 1 Bits | Bit Manipulation | - | - | Java | Easy |
206 | Reverse Linked List | Linked List | - | - | Java | Easy |
217 | Contains Duplicate | Array | - | - | Java | Easy |
234 | Palindrome Linked List | Linked List | - | - | Java | Easy |
237 | Delete Node in a Linked List | Linked List | - | - | Java | Easy |
242 | Valid Anagram | String | - | - | Java | Easy |
268 | Missing Number | Math | - | - | Java | Easy |
283 | Move Zeroes | Array | - | - | Java | Easy |
326 | Power of Three | Math | - | - | Java | Easy |
334 | Increasing Triplet Subsequence | Array | O(n) | O(1) | Java | Medium |
344 | Reverse String | String | - | - | Java | Easy |
349 | Intersection of Two Arrays | Array | O(n) | O(n) | Java | Easy |
350 | Intersection of Two Arrays II | Array | - | - | Java | Easy |
387 | First Unique Character in a String | String | - | - | Java | Easy |
412 | Fizz Buzz | Math | - | - | Java | Easy |