Skip to content

About

Convert freeCodeCamp Java Code to Python with step-by-step visuals 🖼️ and animations 🎞️ | NeetCode 150 🧩

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

NeetCode 150+ Algorithm Solutions 🚀

Overview

This repository contains 193 Python 🐍 and 168 Java ☕ solutions to LeetCode problems, with a focus on the NeetCode 150 🌊 - a curated list of essential coding interview questions! 💻

Legend

Symbol Meaning
🐍 Python solution available
☕ Java solution available
🌊 Part of NeetCode 150 list
📊 Interactive visualization available

Quick Stats

Category Count
Python Solutions 🐍 193
Java Solutions ☕ 168
NeetCode 150 🌊 150
Visualizations 📊 193

👉 Open index.html to browse all problems with interactive visualizations.

main

Problem Categories 📋

Array & Hashing 📊

# Problem 🐍 ☕ 🌊 📊
1 Two Sum ✅ ❌ ✅ Visual
36 Valid Sudoku ✅ ✅ ✅ Visual
49 Group Anagrams ✅ ✅ ✅ Visual
88 Merge Sorted Array ✅ ✅ ❌ Visual
118 Pascal's Triangle ✅ ✅ ❌ Visual
128 Longest Consecutive Sequence ✅ ✅ ✅ Visual
169 Majority Element ✅ ✅ ❌ Visual
202 Happy Number ✅ ✅ ✅ Visual
217 Contains Duplicate ✅ ✅ ✅ Visual
238 Product of Array Except Self ✅ ✅ ✅ Visual
242 Valid Anagram ✅ ✅ ✅ Visual
271 Encode and Decode Strings ✅ ✅ ✅ Visual
289 Game of Life ✅ ✅ ❌ Visual
347 Top K Frequent Elements ✅ ✅ ✅ Visual
380 Insert Delete GetRandom O(1) ✅ ✅ ❌ Visual
412 Fizz Buzz ✅ ✅ ❌ Visual
953 Verifying an Alien Dictionary ✅ ✅ ❌ Visual
1086 High Five ✅ ✅ ❌ Visual

Two Pointers 👉👉

# Problem 🐍 ☕ 🌊 📊
11 Container With Most Water ✅ ✅ ✅ Visual
15 3Sum ✅ ✅ ✅ Visual
42 Trapping Rain Water ✅ ✅ ✅ Visual
125 Valid Palindrome ✅ ✅ ✅ Visual
167 Two Sum II ✅ ✅ ✅ Visual

Sliding Window 🪟

# Problem 🐍 ☕ 🌊 📊
3 Longest Substring Without Repeating Characters ✅ ✅ ✅ Visual
76 Minimum Window Substring ✅ ✅ ✅ Visual
121 Best Time to Buy and Sell Stock ✅ ✅ ✅ Visual
239 Sliding Window Maximum ✅ ✅ ✅ Visual
346 Moving Average from Data Stream ✅ ✅ ❌ Visual
424 Longest Repeating Character Replacement ✅ ✅ ✅ Visual
567 Permutation in String ✅ ✅ ✅ Visual

Stack 📚

# Problem 🐍 ☕ 🌊 📊
20 Valid Parentheses ✅ ✅ ✅ Visual
22 Generate Parentheses ✅ ✅ ✅ Visual
32 Longest Valid Parentheses ✅ ✅ ❌ Visual
84 Largest Rectangle in Histogram ✅ ❌ ✅ Visual
150 Evaluate Reverse Polish Notation ✅ ✅ ✅ Visual
155 Min Stack ✅ ✅ ✅ Visual
716 Max Stack ✅ ✅ ❌ Visual
739 Daily Temperatures ✅ ✅ ✅ Visual
853 Car Fleet ✅ ❌ ✅ Visual
1249 Minimum Remove to Make Valid Parentheses ✅ ✅ ❌ Visual

Binary Search 🔍

# Problem 🐍 ☕ 🌊 📊
4 Median of Two Sorted Arrays ✅ ✅ ✅ Visual
33 Search in Rotated Sorted Array ✅ ✅ ✅ Visual
34 Find First and Last Position of Element ✅ ✅ ❌ Visual
74 Search a 2D Matrix ✅ ✅ ✅ Visual
153 Find Minimum in Rotated Sorted Array ✅ ✅ ✅ Visual
704 Binary Search ✅ ✅ ✅ Visual
875 Koko Eating Bananas ✅ ✅ ✅ Visual
981 Time Based Key-Value Store ✅ ✅ ✅ Visual

Linked List 🔗

# Problem 🐍 ☕ 🌊 📊
2 Add Two Numbers ✅ ✅ ✅ Visual
19 Remove Nth Node From End of List ✅ ✅ ✅ Visual
21 Merge Two Sorted Lists ✅ ✅ ✅ Visual
23 Merge K Sorted Lists ✅ ✅ ✅ Visual
24 Swap Nodes in Pairs ✅ ❌ ❌ Visual
25 Reverse Nodes in k-Group ✅ ✅ ✅ Visual
138 Copy List with Random Pointer ✅ ✅ ✅ Visual
141 Linked List Cycle ✅ ✅ ✅ Visual
143 Reorder List ✅ ✅ ✅ Visual
146 LRU Cache ✅ ✅ ✅ Visual
148 Sort List ✅ ✅ ❌ Visual
206 Reverse Linked List ✅ ✅ ✅ Visual
234 Palindrome Linked List ✅ ✅ ❌ Visual
287 Find the Duplicate Number ✅ ✅ ✅ Visual
876 Middle of the Linked List ✅ ✅ ❌ Visual

Trees 🌳

# Problem 🐍 ☕ 🌊 📊
94 Binary Tree Inorder Traversal ✅ ❌ ❌ Visual
98 Validate Binary Search Tree ✅ ✅ ✅ Visual
100 Same Tree ✅ ✅ ✅ Visual
101 Symmetric Tree ✅ ✅ ❌ Visual
102 Binary Tree Level Order Traversal ✅ ✅ ✅ Visual
103 Binary Tree Zigzag Level Order Traversal ✅ ✅ ❌ Visual
104 Maximum Depth of Binary Tree ✅ ✅ ✅ Visual
105 Construct Binary Tree from Preorder and Inorder ✅ ❌ ✅ Visual
108 Convert Sorted Array to Binary Search Tree ✅ ❌ ❌ Visual
110 Balanced Binary Tree ✅ ✅ ✅ Visual
111 Minimum Depth of Binary Tree ✅ ❌ ❌ Visual
112 Path Sum ✅ ❌ ❌ Visual
113 Path Sum II ✅ ❌ ❌ Visual
114 Flatten Binary Tree to Linked List ✅ ✅ ❌ Visual
124 Binary Tree Maximum Path Sum ✅ ✅ ✅ Visual
199 Binary Tree Right Side View ✅ ✅ ✅ Visual
208 Implement Trie (Prefix Tree) ✅ ✅ ✅ Visual
211 Design Add and Search Words Data Structure ✅ ✅ ✅ Visual
212 Word Search II ✅ ✅ ✅ Visual
226 Invert Binary Tree ✅ ✅ ✅ Visual
230 Kth Smallest Element in a BST ✅ ❌ ✅ Visual
235 Lowest Common Ancestor of a BST ✅ ✅ ✅ Visual
297 Serialize and Deserialize Binary Tree ✅ ✅ ✅ Visual
366 Find Leaves of Binary Tree ✅ ✅ ❌ Visual
543 Diameter of Binary Tree ✅ ✅ ✅ Visual
572 Subtree of Another Tree ✅ ✅ ✅ Visual
1448 Count Good Nodes in Binary Tree ✅ ✅ ✅ Visual

Heap / Priority Queue ⛰️

# Problem 🐍 ☕ 🌊 📊
215 Kth Largest Element in an Array ✅ ✅ ✅ Visual
295 Find Median from Data Stream ✅ ✅ ✅ Visual
355 Design Twitter ✅ ✅ ✅ Visual
621 Task Scheduler ✅ ✅ ✅ Visual
703 Kth Largest Element in a Stream ✅ ✅ ✅ Visual
973 K Closest Points to Origin ✅ ✅ ✅ Visual
1046 Last Stone Weight ✅ ✅ ✅ Visual
1851 Minimum Interval to Include Each Query ✅ ✅ ✅ Visual

Graphs 🗺️

# Problem 🐍 ☕ 🌊 📊
127 Word Ladder ✅ ✅ ✅ Visual
130 Surrounded Regions ✅ ✅ ✅ Visual
133 Clone Graph ✅ ✅ ✅ Visual
200 Number of Islands ✅ ✅ ✅ Visual
207 Course Schedule ✅ ✅ ✅ Visual
210 Course Schedule II ✅ ✅ ✅ Visual
261 Graph Valid Tree ✅ ✅ ✅ Visual
269 Alien Dictionary ✅ ✅ ✅ Visual
277 Find the Celebrity ✅ ✅ ❌ Visual
286 Walls and Gates ✅ ✅ ✅ Visual
323 Number of Connected Components ✅ ✅ ✅ Visual
329 Longest Increasing Path in a Matrix ✅ ✅ ✅ Visual
332 Reconstruct Itinerary ✅ ✅ ✅ Visual
417 Pacific Atlantic Water Flow ✅ ✅ ✅ Visual
547 Number of Provinces ✅ ✅ ❌ Visual
684 Redundant Connection ✅ ✅ ✅ Visual
695 Max Area of Island ✅ ✅ ✅ Visual
743 Network Delay Time ✅ ✅ ✅ Visual
778 Swim in Rising Water ✅ ❌ ✅ Visual
787 Cheapest Flights Within K Stops ✅ ✅ ✅ Visual
994 Rotting Oranges ✅ ✅ ✅ Visual
1584 Min Cost to Connect All Points ✅ ✅ ✅ Visual

Dynamic Programming 📈

# Problem 🐍 ☕ 🌊 📊
5 Longest Palindromic Substring ✅ ✅ ✅ Visual
10 Regular Expression Matching ✅ ✅ ✅ Visual
45 Jump Game II ✅ ✅ ✅ Visual
53 Maximum Subarray ✅ ✅ ✅ Visual
55 Jump Game ✅ ✅ ✅ Visual
62 Unique Paths ✅ ✅ ✅ Visual
70 Climbing Stairs ✅ ✅ ✅ Visual
72 Edit Distance ✅ ❌ ✅ Visual
91 Decode Ways ✅ ❌ ✅ Visual
97 Interleaving String ✅ ❌ ✅ Visual
115 Distinct Subsequences ✅ ✅ ✅ Visual
139 Word Break ✅ ✅ ✅ Visual
152 Maximum Product Subarray ✅ ✅ ✅ Visual
198 House Robber ✅ ✅ ✅ Visual
213 House Robber II ✅ ✅ ✅ Visual
300 Longest Increasing Subsequence ✅ ✅ ✅ Visual
309 Best Time to Buy and Sell Stock with Cooldown ✅ ✅ ✅ Visual
312 Burst Balloons ✅ ✅ ✅ Visual
322 Coin Change ✅ ✅ ✅ Visual
416 Partition Equal Subset Sum ✅ ✅ ✅ Visual
494 Target Sum ✅ ✅ ✅ Visual
518 Coin Change II ✅ ✅ ✅ Visual
647 Palindromic Substrings ✅ ❌ ✅ Visual
746 Min Cost Climbing Stairs ✅ ✅ ✅ Visual
818 Race Car ✅ ❌ ❌ Visual
1143 Longest Common Subsequence ✅ ✅ ✅ Visual

Greedy 🤑

# Problem 🐍 ☕ 🌊 📊
134 Gas Station ✅ ✅ ✅ Visual
179 Largest Number ✅ ✅ ❌ Visual
678 Valid Parenthesis String ✅ ✅ ✅ Visual
763 Partition Labels ✅ ❌ ✅ Visual
846 Hand of Straights ✅ ✅ ✅ Visual
1899 Merge Triplets to Form Target Triplet ✅ ✅ ✅ Visual

Backtracking ↩️

# Problem 🐍 ☕ 🌊 📊
17 Letter Combinations of a Phone Number ✅ ❌ ✅ Visual
39 Combination Sum ✅ ✅ ✅ Visual
40 Combination Sum II ✅ ✅ ✅ Visual
46 Permutations ✅ ✅ ✅ Visual
51 N-Queens ✅ ✅ ✅ Visual
78 Subsets ✅ ✅ ✅ Visual
79 Word Search ✅ ❌ ✅ Visual
90 Subsets II ✅ ✅ ✅ Visual
131 Palindrome Partitioning ✅ ✅ ✅ Visual

Math & Geometry 📐

# Problem 🐍 ☕ 🌊 📊
7 Reverse Integer ✅ ✅ ✅ Visual
43 Multiply Strings ✅ ✅ ✅ Visual
48 Rotate Image ✅ ✅ ✅ Visual
50 Pow(x, n) ✅ ✅ ✅ Visual
54 Spiral Matrix ✅ ✅ ✅ Visual
66 Plus One ✅ ✅ ✅ Visual
73 Set Matrix Zeroes ✅ ❌ ✅ Visual
136 Single Number ✅ ✅ ✅ Visual
190 Reverse Bits ✅ ✅ ✅ Visual
191 Number of 1 Bits ✅ ✅ ✅ Visual
268 Missing Number ✅ ✅ ✅ Visual
338 Counting Bits ✅ ✅ ✅ Visual
371 Sum of Two Integers ✅ ✅ ✅ Visual
2013 Detect Squares ✅ ✅ ✅ Visual

Intervals 📅

# Problem 🐍 ☕ 🌊 📊
56 Merge Intervals ✅ ✅ ✅ Visual
57 Insert Interval ✅ ✅ ✅ Visual
252 Meeting Rooms ✅ ✅ ✅ Visual
253 Meeting Rooms II ✅ ✅ ✅ Visual
435 Non-overlapping Intervals ✅ ✅ ✅ Visual
759 Employee Free Time ✅ ✅ ❌ Visual
1272 Remove Interval ✅ ✅ ❌ Visual

String 🔤

# Problem 🐍 ☕ 🌊 📊
6 Zigzag Conversion ✅ ❌ ❌ Visual
8 String to Integer (atoi) ✅ ❌ ❌ Visual
9 Palindrome Number ✅ ❌ ❌ Visual
12 Integer to Roman ✅ ❌ ❌ Visual
13 Roman to Integer ✅ ✅ ❌ Visual
14 Longest Common Prefix ✅ ✅ ❌ Visual
31 Next Permutation ✅ ✅ ❌ Visual
41 First Missing Positive ✅ ✅ ❌ Visual
68 Text Justification ✅ ✅ ❌ Visual

Design 🏗️

# Problem 🐍 ☕ 🌊 📊
348 Design Tic-Tac-Toe ✅ ✅ ❌ Visual
359 Logger Rate Limiter ✅ ✅ ❌ Visual

Summary by Problem Count

Category Python 🐍 Java ☕ Visuals 📊
Array & Hashing 18 17 18
Two Pointers 5 5 5
Sliding Window 7 7 7
Stack 10 8 10
Binary Search 8 8 8
Linked List 15 14 15
Trees 27 20 27
Heap / Priority Queue 8 8 8
Graphs 22 21 22
Dynamic Programming 26 21 26
Greedy 6 5 6
Backtracking 9 7 9
Math & Geometry 14 13 14
Intervals 7 7 7
String 9 5 9
Design 2 2 2
TOTAL 193 168 193

How to Use 🤔

  1. Navigate to the category you're interested in
  2. Pick a problem and review the solution (🐍 for Python, ☕ for Java)
  3. Check if it's part of NeetCode 150 (🌊) for interview prep priority
  4. Open the visualization (📊) for step-by-step algorithm animation

Source

These solutions were adapted from the freeCodeCamp article on NeetCode 150 and refactored into this organized format.

License 📄

MIT License.

About

Convert freeCodeCamp Java Code to Python with step-by-step visuals 🖼️ and animations 🎞️ | NeetCode 150 🧩

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages