If you find this repository helpful, please give me a star to inspire me to keep it updated and benefit more people. Thank you! 🌟
NOTE: This repository is marked as complete and I have stopped updating it. If you'd like to see well-commented (PEP8 and Google style) and optimized solutions, check out my LeetCode Grind 169 repository!
Grind 75 is a dynamic list of top LeetCode interview questions created in 2023. It's up-to-date and well-chosen, and we can personalize it according to our schedule, time constraints, and preferences.
Blind 75, on the other hand, is a curated list of LeetCode questions created in 2018. We can practice these questions to save time in the job-finding process. Many other LeetCode problems are technical mixes of these individual problems. I practice Blind 75 in parallel on this repository.
To achieve the review of the application of the following data structures and algorithms, except the theory of NP-Completeness.
- Data Structures: (1) Arrays; (2) Stacks and Queues; (3) Linked Lists; (4) Trees; (5) Graphs; (6) Sorting; (7) Hashing.
- Algorithms: (1) Greedy Method; (2) Divide and Conquer; (3) Tree Searching Strategies; (4) Prune and Search; (5) Dynamic Programming.
- Start Date: Apr 12, 2023
- Completion Date: Apr 14, 2024 ⛳️
In this repository, you'll find each question meticulously solved with a focus on clarity and efficiency. To ensure you can verify and understand the solutions:
- Organized Folders: Solutions are neatly organized into folders, labeled from Part 1 to Part 8, for easy navigation.
- Test Cases: Each solution is accompanied by test cases that validate the code and demonstrate its correctness.
- Complexity Analysis: Time and space complexities are provided for each solution, giving you insights into the efficiency of the algorithms used.
Feel free to delve into the solutions, run the test cases, and review the complexity analysis to deepen your understanding of each problem. This hands-on approach is designed to help you become proficient in coding interviews, where such analyses are crucial.
- Easy 1. Two Sum (picked in Blind 75)
- Easy 20. Valid Parentheses (picked in Blind 75)
- Easy 21. Merge Two Sorted Lists (picked in Blind 75)
- Easy 110. Balanced Binary Tree
- Easy 121. Best Time to Buy and Sell Stock (picked in Blind 75)
- Easy 125. Valid Palindrome (picked in Blind 75) | Algo: Regular Expressions, Two-Pointers Technique, String Manipulation
- Easy 141. Linked List Cycle (picked in Blind 75) | Algo: Floyd's Cycle Finding (Two-Pointers Technique)
- Easy 226. Invert Binary Tree (picked in Blind 75)
- Easy 232. Implement Queue using Stacks
- Easy 242. Valid Anagram (picked in Blind 75)
- Easy 704. Binary Search
- Easy 733. Flood Fill
- Medium 235. Lowest Common Ancestor of a Binary Search Tree (picked in Blind 75)
- Easy 67. Add Binary
- Easy 70. Climbing Stairs (picked in Blind 75) | Algo: Dynamic Programming
- Easy 104. Maximum Depth of Binary Tree (picked in Blind 75) | Algo: Depth-First Search
- Easy 169. Majority Element Algo: Moore Voting Algo
- Easy 206. Reverse Linked List (picked in Blind 75)
- Easy 217. Contains Duplicate
- Easy 278. First Bad Version Algo: Binary Search Algo (Divide and Conquer)
- Easy 383. Ransom Note
- Easy 409. Longest Palindrome
- Easy 543. Diameter of Binary Tree Algo: Depth-First Search; Another Takeaway: Mutable Objects (list, dict, set)
- ⭐️ Easy 876. Middle of the Linked List
- Medium 53. Maximum Subarray (picked in Blind 75) | Algo: Kadane's Algo
- Medium 3. Longest Substring Without Repeating Characters (picked in Blind 75) | Algo: Sliding Window Technique
- ⭐️ Medium 15. 3Sum (picked in Blind 75) | Algo: Two-Pointer Technique and Dictionary (Hashmap); DS: Hashing
- Medium 57. Insert Interval (picked in Blind 75)
- Medium 102. Binary Tree Level Order Traversal (picked in Blind 75) | Algo: Breadth-First Search
- Medium 133. Clone Graph (picked in Blind 75) | Algo: Breadth-First Search
- Medium 150. Evaluate Reverse Polish Notation
- Medium 542. 01 Matrix | Algo: Multi-Source Breadth-First Search
- Medium 973. K Closest Points to Origin | Algo & DS: Heap Sort
- ⭐️ Medium 98. Validate Binary Search Tree (picked in Blind 75) | Algo: Depth-First Search
- ⭐️ Medium 155. Min Stack | DS: Stack
- Medium 200. Number of Islands (picked in Blind 75) | Algo: Depth-First Search
- ⭐️ Medium 207. Course Schedule (picked in Brind 75) | Algo: Depth-First Search
- Medium 208. Implement Trie (Prefix Tree) | DS: Trie Tree
- Medium 238. Product of Array Except Self (picked in Blind 75)
- ⭐️ Medium 322. Coin Change (picked in Blind 75) | Algo: Dynamic Programming
- Medium 994. Rotting Oranges | Algo: Breadth-First Search
- ⭐️ Medium 33. Search in Rotated Sorted Array (picked in Blind 75)
- ⭐️ Medium 39. Combination Sum | Algo: Backtracking
- Medium 46. Permutations | Algo: Backtracking
- Medium 56. Merge Intervals (picked in Blind 75)
- Medium 75. Sort Colors | Algo: Dutch National Flag
- Medium 236. Lowest Common Ancestor of a Binary Tree | Algo: Depth-First Search
- ⭐️ Medium 721. Accounts Merge | DS: Disjoint Set Union (DSU or Union–Find Data Structure)
- ⭐️ Medium 981. Time Based Key-Value Store | Algo: Binary Search
- ⭐️ Medium 5. Longest Palindromic Substring (picked in Blind 75) | Algo: Expand Around Center & Two-Pointers Techniques
- ⭐️ Medium 8. String to Integer (atoi) | DS: Overflow Handling
- Medium 54. Spiral Matrix (picked in Blind 75)
- Medium 62. Unique Paths (picked in Blind 75) | Algo: Dynamic Programming
- Medium 78. Subsets
- ⭐️ Medium 105. Construct Binary Tree from Preorder and Inorder Traversal (picked in Blind 75) | Algo: Preorder & Inorder Traversal
- Medium 139. Word Break (picked in Blind 75) | Algo: Dynamic Programming
- Medium 199. Binary Tree Right Side View | Algo: Breadth-First Search
- ⭐️ Medium 416. Partition Equal Subset Sum | Algo: Dynamic Programming
- Medium 11. Container With Most Water (picked in Blind 75)
- Medium 17. Letter Combinations of a Phone Number
- Medium 79. Word Search (picked in Blind 75) | Algo: Depth-First Search
- ⭐️ Medium 146. LRU Cache | DS: Doubly Linked List
- Medium 310. Minimum Height Trees | Algo: Centroid Decomposition & Pruning; DS: Adjacency List
- Medium 438. Find All Anagrams in a String | Algo: Fixed-Size Sliding Window; DS: Hash Table
- ⭐️ Medium 621. Task Scheduler | Algo: Greedy Approach; DS: Hash Table
- Medium 230. Kth Smallest Element in a BST (picked in Blind 75) | Algo: Inorder Traversal
- Hard 23. Merge k Sorted Lists (picked in Blind 75) | DS: Min Heap (Priority Queue)
- Hard 42. Trapping Rain Water | Algo: Two-Pointer Technique
- Hard 76. Minimum Window Substring (picked in Blind 75) | Algo: Sliding Window; DS: Hash Table
- ⭐️ Hard 84. Largest Rectangle in Histogram | DS: Stack
- ⭐️ Hard 127. Word Ladder | Algo: Breadth-First Search; DS: Queue, Hash Table
- Hard 224. Basic Calculator
- ⭐️ Hard 295. Find Median from Data Stream (picked in Blind 75) | DS: Min & Max Heaps (Priority Queue)
- Hard 297. Serialize and Deserialize Binary Tree (picked in Blind 75) | Algo: Breadth-First Search; DS: Queue
- ⭐️ Hard 1235. Maximum Profit in Job Scheduling | Algo: Binary Search, Dynamic Programming