Leetcode
Showcasing my solutions to Leetcode problems in Python alongside my thought process and approach to solving them.
Medium
1448. Count Good Nodes in Binary Tree
#binary-tree
#dfs
Medium
199. Binary Tree Right Side View
#binary-tree
#queue
Medium
337. House Robber III
#binary-tree
#dp
Medium
102. Binary Tree Level Order Traversal
#binary-tree
#queue
Hard
23. Merge k Sorted Lists
#linked-list
#heap
Medium
146. LRU Cache
#hashmap
#linked-list
Medium
138. Copy List with Random Pointer
#linked-list
Medium
443. String Compression
#two-pointers
Medium
334. Increasing Triplet Subsequence
#math
#trick
Easy
1768. Merge Strings Alternately
#two-pointers
Medium
Infinite Taxi Driver
#graph
#bfs
Medium
1730. Shortest Path To Get Food
#graph
#bfs
Medium
1642. Furthest Building You Can Reach
#heap
Medium
752. Open the Lock
#graph
#bfs
Medium
Skyscraper Furthest Distance
#heap
Hard
Rummy Card Game
#sliding-window
#math
Medium
Minimum Lock Turns
#graph
#bfs
Hard
Max Level Party Invites
#graph
#dp
#dfs
Medium
235. Lowest Common Ancestor of a Binary Search Tree
#binary-tree
#dfs
Easy
572. Subtree of Another Tree
#binary-tree
#dfs
Easy
100. Same Tree
#binary-tree
#dfs
Easy
110. Balanced Binary Tree
#binary-tree
Hard
239. Sliding Window Maximum
#sliding-window
Hard
42. Trapping Rain Water
#two-pointers
#math
Medium
287. Find the Duplicate Number
#linked-list
#array
Medium
2. Add Two Numbers
#linked-list
#math
Medium
19. Remove Nth Node From End of List
#linked-list
Easy
543. Diameter of Binary Tree
#binary-tree
#dfs
Easy
104. Maximum Depth of Binary Tree
#binary-tree
#dfs
Easy
226. Invert Binary Tree
#binary-tree
#bfs
Medium
143. Reorder List
#linked-list
Easy
141. Linked List Cycle
#linked-list
Easy
21. Merge Two Sorted Lists
#linked-list
Easy
206. Reverse Linked List
#linked-list
Hard
76. Minimum Window Substring
#sliding-window
Medium
567. Permutation in String
#sliding-window
Medium
424. Longest Repeating Character Replacement
#sliding-window
Medium
3. Longest Substring Without Repeating Characters
#sliding-window
Easy
121. Best Time to Buy and Sell Stock
#sliding-window
Medium
33. Search in Rotated Sorted Array
#binary-search
Medium
153. Find Minimum in Rotated Sorted Array
#binary-search
Medium
875. Koko Eating Bananas
#binary-search
#math
Medium
74. Search a 2D Matrix
#binary-search
#matrix
Easy
704. Binary Search
#binary-search
Hard
84. Largest Rectangle in Histogram
#stack
#math
Medium
853. Car Fleet
#stack
#math
Medium
739. Daily Temperatures
#stack
Medium
22. Generate Parentheses
#stack
#recursion
Medium
150. Evaluate Reverse Polish Notation
#stack
#math
Medium
155. Min Stack
#stack
Easy
20. Valid Parentheses
#stack
Medium
11. Container With Most Water
#two-pointers
#math
Medium
15. 3Sum
#binary-search
#two-pointers
Medium
167. Two Sum II - Input Array Is Sorted
#two-pointers
#binary-search
Easy
125. Valid Palindrome
#two-pointers
#string
Medium
128. Longest Consecutive Sequence
#hashmap
#math
Medium
36. Valid Sudoku
#matrix
Medium
238. Product of Array Except Self
#math
Medium
347. Top K Frequent Elements
#hashmap
#frequency
Medium
49. Group Anagrams
#hashmap
#frequency
Easy
242. Valid Anagram
#hashmap
#frequency
Easy
217. Contains Duplicate
#hashmap
Easy
1. Two Sum
#hashmap
#math