Skip to content

kimtth/neet-code-top-150-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

NeetCode 150 - Python Solutions ๐Ÿš€

Overview

This repository contains Python solutions to the NeetCode 150 problems - a curated list of LeetCode questions designed to help you ace the coding interviews! ๐Ÿ’ป

The solutions are organized by problem categories to make it easier to focus on specific areas. Each solution includes a link to the LeetCode problem and, when available, a link to a video explanation.

Source

These solutions were adapted from the freeCodeCamp article on NeetCode 150 and refactored into this organized format. The original Java solutions were converted to Python.

Problem Categories ๐Ÿ“‹

Array & Hashing ๐Ÿ“Š

# Problem Solution Video
1 Two Sum Solution Video
49 Group Anagrams Solution Video
347 Top K Frequent Elements Solution Video
242 Valid Anagram Solution Video
953 Verifying an Alien Dictionary Solution Video

Two Pointers ๐Ÿ‘‰๐Ÿ‘‰

# Problem Solution Video
15 3Sum Solution Video
125 Valid Palindrome Solution Video

Sliding Window ๐ŸชŸ

# Problem Solution Video
3 Longest Substring Without Repeating Characters Solution Video
121 Best Time to Buy and Sell Stock Solution Video

Stack ๐Ÿ“š

# Problem Solution Video
20 Valid Parentheses Solution Video
32 Longest Valid Parentheses Solution Video
150 Evaluate Reverse Polish Notation Solution Video
853 Car Fleet Solution Video
1249 Minimum Remove to Make Valid Parentheses Solution Video

Binary Search ๐Ÿ”

# Problem Solution Video
33 Search in Rotated Sorted Array Solution Video
153 Find Minimum in Rotated Sorted Array Solution Video
875 Koko Eating Bananas Solution Video
74 Search a 2D Matrix Solution Video
704 Binary Search Solution Video
34 Find First and Last Position of Element in Sorted Array Solution Video

Linked List ๐Ÿ”—

# Problem Solution Video
21 Merge Two Sorted Lists Solution Video
25 Reverse Nodes in k-Group Solution Video
138 Copy List with Random Pointer Solution Video
143 Reorder List Solution Video
148 Sort List Solution Video
141 Linked List Cycle Solution Video
24 Swap Nodes in Pairs Solution Video

Trees ๐ŸŒณ

# Problem Solution Video
98 Validate Binary Search Tree Solution Video
110 Balanced Binary Tree Solution Video
199 Binary Tree Right Side View Solution Video
208 Implement Trie (Prefix Tree) Solution Video
235 Lowest Common Ancestor of a Binary Search Tree Solution Video
297 Serialize and Deserialize Binary Tree Solution Video
366 Find Leaves of Binary Tree Solution Video
1448 Count Good Nodes in Binary Tree Solution Video
108 Convert Sorted Array to Binary Search Tree Solution Video

Heap / Priority Queue โ›ฐ๏ธ

# Problem Solution Video
621 Task Scheduler Solution Video
973 K Closest Points to Origin Solution Video
1046 Last Stone Weight Solution Video
1851 Minimum Interval to Include Each Query Solution Video

Graphs ๐Ÿ“Š

# Problem Solution Video
127 Word Ladder Solution Video
130 Surrounded Regions Solution Video
133 Clone Graph Solution Video
210 Course Schedule II Solution Video
286 Walls and Gates Solution Video
332 Reconstruct Itinerary Solution Video
547 Number of Provinces Solution Video
759 Employee Free Time Solution Video
778 Swim in Rising Water Solution Video
994 Rotting Oranges Solution Video
269 Alien Dictionary Solution Video
695 Max Area of Island Solution Video
329 Longest Increasing Path in a Matrix Solution Video

Dynamic Programming ๐Ÿ“ˆ

# Problem Solution Video
5 Longest Palindromic Substring Solution Video
70 Climbing Stairs Solution Video
115 Distinct Subsequences Solution Video
152 Maximum Product Subarray Solution Video
312 Burst Balloons Solution Video
416 Partition Equal Subset Sum Solution Video
494 Target Sum Solution Video
818 Race Car Solution Video
1143 Longest Common Subsequence Solution Video
62 Unique Paths Solution Video
45 Jump Game II Solution Video

Greedy ๐Ÿค‘

# Problem Solution Video
134 Gas Station Solution Video
763 Partition Labels Solution Video

Backtracking โ†ฉ๏ธ

# Problem Solution Video
22 Generate Parentheses Solution Video
46 Permutations Solution Video
51 N-Queens Solution Video
79 Word Search Solution Video
90 Subsets II Solution Video
131 Palindrome Partitioning Solution Video

Math & Geometry ๐Ÿ“

# Problem Solution Video
31 Next Permutation Solution Video
50 Pow(x, n) Solution Video
66 Plus One Solution Video
68 Text Justification Solution Video
73 Set Matrix Zeroes Solution Video
88 Merge Sorted Array Solution Video
179 Largest Number Solution Video
287 Find the Duplicate Number Solution Video
54 Spiral Matrix Solution Video
48 Rotate Image Solution Video
36 Valid Sudoku Solution Video
289 Game of Life Solution Video
7 Reverse Integer Solution Video
9 Palindrome Number Solution Video

Intervals ๐Ÿ“…

# Problem Solution Video
56 Merge Intervals Solution Video
57 Insert Interval Solution Video
435 Non-overlapping Intervals Solution Video

Advanced Data Structures ๐Ÿงฎ

# Problem Solution Video
146 LRU Cache Solution Video
380 Insert Delete GetRandom O(1) Solution Video
981 Time Based Key-Value Store Solution Video
2013 Detect Squares Solution Video

How to Use ๐Ÿค”

  1. Navigate to the category you're interested in
  2. Pick a problem and review the solution
  3. If available, watch the video explanation for deeper understanding
  4. Try implementing the solution yourself before checking the code

License ๐Ÿ“„

This repository is available under the MIT License.

About

Generated Code by an LLM ๐Ÿค– | NeetCode 150 ๐Ÿงฉ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published