Welcome to the LeetCode Top Interview 150 project. This repository contains Top 150 Interview Problems from LeetCode and solutions source code in C++/ Java/ JavaScript/ Python Programming languages.The goal is to provide comprehensive, well-documented solutions to aid in understanding these common interview problems.
I encourage collaboration and invite others to join in this endeavor. Here's how you can contribute:
- Fork the repository by clicking on the 'Fork' button on the top right corner of this page. This will create a copy of this repository on your GitHub account.
git clone https://github.com/muhit-khan/LeetCode-Top-Interview-150.git
git checkout -b new-contributions
- Solve a problem from the LeetCode Top 150 Interview Questions.
- Add your solution to the respective problem directory.
- Ensure your code is well-documented and easy to understand.
git commit -m "Add solution for Problem Down below"
git push origin new-contributions
- Go to your repository on GitHub.
- Click on the 'New Pull Request' button.
- Provide a descriptive title and overview of your changes.
- Submit the Pull Request.
[NB: Maintain a consistent code style to ensure readability. Use descriptive variable and function names. Comment your code to explain the approach and any intricate parts.]
Feel free to open an issue to start a discussion or ask questions. You can reach out to me via:
- WhatsApp: +91 7894978567
- Email: muhitkhan_bd@outlook.com
Let's ace those LeetCode problems together!
Happy Coding! π
Problem | Difficulty | Signal | Status | Solution |
---|---|---|---|---|
Array / String | ||||
Merge Sorted Array | Easy | π’ | ||
Remove Element | Easy | π’ | ||
Remove Duplicates from Sorted Array | Easy | π’ | ||
Remove Duplicates from Sorted Array II | Medium | π‘ | ||
Majority Element | Easy | π’ | ||
Rotate Array | Medium | π‘ | ||
Best Time to Buy and Sell Stock | Easy | π’ | ||
Best Time to Buy and Sell Stock II | Medium | π‘ | ||
Jump Game | Medium | π‘ | ||
Jump Game II | Medium | π‘ | ||
H-Index | Medium | π‘ | ||
Insert Delete GetRandom O(1) | Medium | π‘ | ||
Product of Array Except Self | Medium | π‘ | ||
Gas Station | Medium | π‘ | ||
Candy | Hard | π΄ | ||
Trapping Rain Water | Hard | π΄ | ||
Roman to Integer | Easy | π’ | ||
Integer to Roman | Medium | π‘ | ||
Length of Last Word | Easy | π’ | ||
Longest Common Prefix | Easy | π’ | ||
Reverse Words in a String | Medium | π‘ | ||
Zigzag Conversion | Medium | π‘ | ||
Find the Index of the First Occurrence in a String | Easy | π’ | ||
Text Justification | Hard | π΄ | ||
Two Pointers | ||||
Valid Palindrome | Easy | π’ | ||
Is Subsequence | Easy | π’ | ||
Two Sum II - Input Array Is Sorted | Medium | π‘ | ||
Container With Most Water | Medium | π‘ | ||
3Sum | Medium | π‘ | ||
Sliding Window | ||||
Minimum Size Subarray Sum | Medium | π‘ | ||
Longest Substring Without Repeating Characters | Medium | π‘ | ||
Substring with Concatenation of All Words | Hard | π΄ | ||
Minimum Window Substring | Hard | π΄ | ||
Matrix | ||||
Valid Sudoku | Medium | π‘ | ||
Spiral Matrix | Medium | π‘ | ||
Rotate Image | Medium | π‘ | ||
Set Matrix Zeroes | Medium | π‘ | ||
Game of Life | Medium | π‘ | ||
Hashmap | ||||
Ransom Note | Easy | π’ | ||
Isomorphic Strings | Easy | π’ | ||
Word Pattern | Easy | π’ | ||
Valid Anagram | Easy | π’ | ||
Group Anagrams | Medium | π‘ | ||
Two Sum | Easy | π’ | ||
Happy Number | Easy | π’ | ||
Contains Duplicate II | Easy | π’ | ||
Longest Consecutive Sequence | Medium | π‘ | ||
Intervals | ||||
Summary Ranges | Easy | π’ | ||
Merge Intervals | Medium | π‘ | ||
Insert Interval | Medium | π‘ | ||
Minimum Number of Arrows to Burst Balloons | Medium | π‘ | ||
Stack | ||||
Valid Parentheses | Easy | π’ | ||
Simplify Path | Medium | π‘ | ||
Min Stack | Medium | π‘ | ||
Evaluate Reverse Polish Notation | Medium | π‘ | ||
Basic Calculator | Hard | π΄ | ||
Linked List | ||||
Linked List Cycle | Easy | π’ | ||
Add Two Numbers | Medium | π‘ | ||
Merge Two Sorted Lists | Easy | π’ | ||
Copy List with Random Pointer | Medium | π‘ | ||
Reverse Linked List II | Medium | π‘ | ||
Reverse Nodes in k-Group | Hard | π΄ | ||
Remove Nth Node From End of List | Medium | π‘ | ||
Remove Duplicates from Sorted List II | Medium | π‘ | ||
Rotate List | Medium | π‘ | ||
Partition List | Medium | π‘ | ||
LRU Cache | Medium | π‘ | ||
Binary Tree General | ||||
Maximum Depth of Binary Tree | Easy | π’ | ||
Same Tree | Easy | π’ | ||
Invert Binary Tree | Easy | π’ | ||
Symmetric Tree | Easy | π’ | ||
Construct Binary Tree from Preorder and Inorder Traversal | Medium | π‘ | ||
Construct Binary Tree from Inorder and Postorder Traversal | Medium | π‘ | ||
Populating Next Right Pointers in Each Node II | Medium | π‘ | ||
Flatten Binary Tree to Linked List | Medium | π‘ | ||
Path Sum | Easy | π’ | ||
Sum Root to Leaf Numbers | Medium | π‘ | ||
Binary Tree Maximum Path Sum | Hard | π΄ | ||
Binary Search Tree Iterator | Medium | π‘ | ||
Count Complete Tree Nodes | Easy | π’ | ||
Binary Tree BFS | ||||
Binary Tree Right Side View | Medium | π‘ | ||
Average of Levels in Binary Tree | Easy | π’ | ||
Binary Tree Level Order Traversal | Medium | π‘ | ||
Binary Tree Zigzag Level Order Traversal | Medium | π‘ | ||
Binary Search Tree | ||||
Minimum Absolute Difference in BST | Easy | π’ | ||
Kth Smallest Element in a BST | Medium | π‘ | ||
Validate Binary Search Tree | Medium | π‘ | ||
Graph General | ||||
Number of Islands | Medium | π‘ | ||
Surrounded Regions | Medium | π‘ | ||
Clone Graph | Medium | π‘ | ||
Evaluate Division | Medium | π‘ | ||
Course Schedule | Medium | π‘ | ||
Course Schedule II | Medium | π‘ | ||
Graph BFS | ||||
Snakes and Ladders | Medium | π‘ | ||
Minimum Genetic Mutation | Medium | π‘ | ||
Word Ladder | Hard | π΄ | ||
Trie | ||||
Implement Trie (Prefix Tree) | Medium | π‘ | ||
Design Add and Search Words Data Structure | Medium | π‘ | ||
Word Search II | Hard | π΄ | ||
Backtracking | ||||
Letter Combinations of a Phone Number | Medium | π‘ | ||
Combinations | Medium | π‘ | ||
Permutations | Medium | π‘ | ||
Combination Sum | Medium | π‘ | ||
N-Queens II | Hard | π΄ | ||
Generate Parentheses | Medium | π‘ | ||
Word Search | Medium | π‘ | ||
Divide & Conquer | ||||
Convert Sorted Array to Binary Search Tree | Easy | π’ | ||
Sort List | Medium | π‘ | ||
Construct Quad Tree | Medium | π‘ | ||
Merge k Sorted Lists | Hard | π΄ | ||
Kadane's Algorithm | ||||
Maximum Subarray | Medium | π‘ | ||
Maximum Sum Circular Subarray | Medium | π‘ | ||
Binary Search | ||||
Search Insert Position | Easy | π’ | ||
Search a 2D Matrix | Medium | π‘ | ||
Find Peak Element | Medium | π‘ | ||
Search in Rotated Sorted Array | Medium | π‘ | ||
Find First and Last Position of Element in Sorted Array | Medium | π‘ | ||
Find Minimum in Rotated Sorted Array | Medium | π‘ | ||
Median of Two Sorted Arrays | Hard | π΄ | ||
Heap | ||||
Kth Largest Element in an Array | Medium | π‘ | ||
IPO | Hard | π΄ | ||
Find K Pairs with Smallest Sums | Medium | π‘ | ||
Find Median from Data Stream | Hard | π΄ | ||
Bit Manipulation | ||||
Add Binary | Easy | π’ | ||
Reverse Bits | Easy | π’ | ||
Number of 1 Bits | Easy | π’ | ||
Single Number | Easy | π’ | ||
Single Number II | Medium | π‘ | ||
Bitwise AND of Numbers Range | Medium | π‘ | ||
Math | ||||
Palindrome Number | Easy | π’ | ||
Plus One | Easy | π’ | ||
Factorial Trailing Zeroes | Medium | π‘ | ||
Sqrt(x) | Easy | π’ | ||
Pow(x, n) | Medium | π‘ | ||
Max Points on a Line | Hard | π΄ | ||
1D DP | ||||
Climbing Stairs | Easy | π’ | ||
House Robber | Medium | π‘ | ||
Word Break | Medium | π‘ | ||
Coin Change | Medium | π‘ | ||
Longest Increasing Subsequence | Medium | π‘ | ||
Multidimensional DP | ||||
Triangle | Medium | π‘ | ||
Minimum Path Sum | Medium | π‘ | ||
Unique Paths II | Medium | π‘ | ||
Longest Palindromic Substring | Medium | π‘ | ||
Interleaving String | Medium | π‘ | ||
Edit Distance | Medium | π‘ | ||
Best Time to Buy and Sell Stock III | Hard | π΄ | ||
Best Time to Buy and Sell Stock IV | Hard | π΄ | ||
Maximal Square | Medium | π‘ |
This project is licensed under the MIT License.