Skip to content

Instantly share code, notes, and snippets.

@johan456789
Last active April 6, 2024 02:34
Show Gist options
  • Save johan456789/f31071e5ca9e5a006e99ed0b1221fd06 to your computer and use it in GitHub Desktop.
Save johan456789/f31071e5ca9e5a006e99ed0b1221fd06 to your computer and use it in GitHub Desktop.
NeetCode 150 with LeetCode numbering

1. Two Sum - HashMap

2. Add Two Numbers

3. Longest Substring Without Repeating Characters

4. Median of Two Sorted Arrays - Binary Search

5. Longest Palindromic Substring - Python

7. Reverse Integer - Bit Manipulation

10. Regular Expression Matching - Dynamic Programming Top-Down Memoization

11. Container with Most Water

15. 3Sum

17. Letter Combinations of a Phone Number - Backtracking

19. Remove Nth Node from End of List - Oracle Interview Question

20. Valid Parentheses - Stack

21. Merge Two Sorted Lists

22. Generate Parentheses - Stack

23. Merge K Sorted Lists

25. Reverse Nodes in K-Group - Linked List

33. Search in rotated sorted array

36. Valid Sudoku - Amazon Interview Question

39. Combination Sum - Backtracking

40. Combination Sum II - Backtracking

42. Trapping Rain Water - Google Interview Question

43. Multiply Strings

45. Jump Game II - Greedy

46. Backtracking: Permutations

48. Rotate Image - Matrix

49. Group Anagrams - Categorize Strings by Count

50. Pow(x, n) - X to the power of N

51. N-Queens - Backtracking

53. Maximum Subarray - Amazon Coding Interview Question

54. Spiral Matrix - Microsoft Interview Question

55. Jump Game - Greedy

56. Merge Intervals - Sorting

57. Insert Interval

62. Unique Paths - Dynamic Programming

66. Plus One

70. Climbing Stairs - Dynamic Programming

72. Edit Distance - Dynamic Programming

73. Set Matrix Zeroes - In-place

74. Search a 2D Matrix

76. Minimum Window Substring - Airbnb Interview Question

78. Subsets - Backtracking

79. Word Search - Backtracking

84. LARGEST RECTANGLE IN HISTOGRAM

90. Subsets II - Backtracking

91. Decode Ways - Dynamic Programming

97. Interleaving Strings - Dynamic Programming

98. Validate Binary Search Tree - Depth First Search

100. Same Tree

102. Binary Tree Level Order Traversal - BFS

104. Maximum Depth of Binary Tree - 3 Solutions

105. Construct Binary Tree from Inorder and Preorder Traversal

110. Balanced Binary Tree

115. Distinct Subsequences - Dynamic Programming

121. Sliding Window: Best Time to Buy and Sell Stock

124. Binary Tree Maximum Path Sum - DFS

125. Valid Palindrome

127. Word Ladder - Breadth First Search

128. LONGEST CONSECUTIVE SEQUENCE

130. Surrounded Regions - Graph

131. Palindrome Partitioning - Backtracking

133. Clone Graph - Depth First Search

134. Gas Station - Greedy

136. Single Number

138. Copy List with Random Pointer - Linked List

139. Word Break - Dynamic Programming

141. Linked List Cycle - Floyd's Tortoise and Hare

143. Linkedin Interview Question - Reorder List

146. LRU Cache - Twitch Interview Question

150. Evaluate Reverse Polish Notation

152. Maximum Product Subarray - Dynamic Programming

153. Find Minimum in Rotated Sorted Array - Binary Search

155. Design Min Stack - Amazon Interview Question

167. TWO SUM II - Amazon Coding Interview Question

190. Reverse Bits - Binary

191. Number of 1 Bits

198. House Robber - Dynamic Programming

199. Binary Tree Right Side View - Breadth First Search

200. NUMBER OF ISLANDS

202. Happy Number

206. Reverse Linked List - Iterative AND Recursive

207. Course Schedule - Graph Adjacency List

208. Implement Trie (Prefix Tree)

210. Course Schedule II - Topological Sort

211. Design Add and Search Words Data Structure

212. Word Search II - Backtracking Trie

213. House Robber II - Dynamic Programming

215. Kth Largest Element in an Array - Quick Select

217. Contains Duplicate

226. Invert Binary Tree - Depth First Search

230. Kth Smallest Element in a BST

235. Lowest Common Ancestor of a Binary Search Tree

238. Product of Array Except Self

239. Sliding Window Maximum - Monotonic Queue

242. Valid Anagram

252. Meeting Rooms

253. Meeting Rooms II

261. Graph Valid Tree

268. Missing Number - Blind 75

269. Alien Dictionary - Topological Sort

271. Encode and Decode Strings

286. Walls and Gates - Multi-Source BFS

287. Find the Duplicate Number - Floyd's Cycle Detection

295. Find Median from Data Stream - Heap & Priority Queue

297. Serialize and Deserialize Binary Tree - Preorder Traversal

300. Longest Increasing Subsequence - Dynamic Programming

309. Best Time to Buy and Sell Stock with Cooldown

312. Burst Baloons - Dynamic Programming

322. Coin Change - Dynamic Programming Bottom Up

323. Number of Connected Components in an Undirected Graph - Union Find

329. Longest Increasing Path in a Matrix

332. Reconstruct Itinerary

338. Counting Bits - Dynamic Programming

347. Top K Frequent Elements - Bucket Sort

355. Design Twitter

371. Sum of Two Integers - Java

416. Partition Equal Subset Sum - Dynamic Programming

417. Pacific Atlantic Water Flow

424. Longest Repeating Character Replacement

435. Non-Overlapping Intervals

494. Target Sum - Dynamic Programming

518. Coin Change 2 - Dynamic Programming Unbounded Knapsack

543. Diameter of a Binary Tree

567. Permutation in String

572. Subtree of Another Tree

621. Task Scheduler

647. Palindromic Substrings - Python

678. Valid Parenthesis String

684. Redundant Connection - Union Find

695. Max Area of Island

703. Kth Largest Element in a Stream

704. Binary Search

739. Daily Temperatures - Monotonic Stack

743. Network Delay Time - Dijkstra's algorithm

746. Min Cost Climbing Stairs - Dynamic Programming

763. Partition Labels

778. Swim in Rising Water - Dijkstra's Algorithm

787. Bellman-Ford - Cheapest Flights within K Stops

846. Hand of Straights

853. Car Fleet

875. Koko Eating Bananas - Binary Search

973. K Closest Points to Origin - Heap / Priority Queue

981. Time Based Key-Value Store

994. Rotting Oranges

1046. Last Stone Weight - Priority Queue

1143. Longest Common Subsequence - Dynamic Programming

1448. Microsoft's Most Asked Question 2021 - Count Good Nodes in a Binary Tree

1584. Prim's Algorithm - Minimum Spanning Tree - Min Cost to Connect all Points

1851. Minimum Interval to Include Each Query

1899. Merge Triplets to Form Target Triplet - Greedy

2013. Detect Squares - Leetcode Weekly Contest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment