Got stuck in a LeetCode question? This repository will help you by providing approach of solving the problems from LeetCode platform.
Contributors helped us in providing these Awesome solutions.
If you want to contribute, please create a Pull Request. If you are new to Github please check pull request procedure ---> PR process
Check out ---> Sample PR
- There are new LeetCode questions every week. I'll keep updating for full summary and better solutions.
- For more challenging problem solutions, you can also see our HackerRank-Solutions, ProjectEuler repositories.
- Hope you enjoy the journey of learning data structures and algorithms.
- Notes: "🔒" means your subscription of LeetCode premium membership is required for reading the question.
- Bit Manipulation
- Array
- String
- Linked List
- Stack
- Queue
- Heap
- Tree
- Hash Table
- Math
- Two Pointers
- Sort
- Recursion
- Binary Search
- Binary Search Tree
- Breadth-First Search
- Depth-First Search
- Backtracking
- Dynamic Programming
- Greedy
- Graph
- Geometry
- Simulation
- Design
- Concurrency
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
0136 | Single Number | Java Python |
O(n) | O(1) | Easy | Using XOR | |
0137 | Single Number II | O(n) | O(1) | Medium | |||
0260 | Single Number III | Python | O(n) | O(1) | Medium |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
56 | Merge Intervals | Python | O(nlogn) | O(n) | Medium | Intervals | |
697 | Degree of an Array | Java | O(n) | O(n) | Easy | Array | |
697 | Duplicate Zeroes | JavaScript | O(n) | O(n) | Easy | Array |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
383 | Ransom Note | Java | O(1) | O(n) | Easy | Character Count | |
151 | Reverse Words in a String | Java | O(1) | O(n) | Medium |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
002 | Add Two Numbers | Java | O(n) | O(n) | Medium | Math |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
020 | Valid Parentheses | Python | O(n) | O(n) | Easy | Stack |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
103 | ZigZag Level Order | JavaScript | O(n) | O(n) | Medium | Binary Tree |
# | Title | Solution | Time | Space | Difficulty | Tag | Video Explanation |
---|---|---|---|---|---|---|---|
001 | Two Sum | Java Python |
O(N) | O(N) | Easy | ||
242 | Valid Anagram | Java | O(n) | O(1) | Easy | Tutorial | |
146 | LRU Cache | Java | Medium |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
5 | Longest Palindromic Substring | Python | O(N^2) | O(N) | Medium | Expand the Wings |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
204 | Count Primes | C++ | O(n(log(logn))) | O(n) | Easy | Math | |
168 | Excel Sheet Column Title | C++ | O(n) | O(n) | Easy | String | |
7 | Reverse Integer | C++ | O(n) | O(n) | Easy | Math |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
5 | Longest Palindromic Substring | Python | O(N^2) | O(N) | Medium | Expand the Wings |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
037 | Sudoku Solver | C++ | O(n^2) | O(1) | Hard | Hash Table |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
416 | Partition Equal Subset Sum | C++ | O(n^2) | O(n^2) | Medium | DP | |
56 | Wildcard Matching | Python | O(n^2) | O(n^2) | Hard |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
278 | First Bad Version | Java JavaScript |
O(logn) | O(1) | Easy | Binary Search | |
33 | Search in Rotated Sorted Array | Python | O(logn) | O(1) | Medium | Binary Search |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
1042 | Flower Planting with No Adjacent | Python | O(V+E) | O(2V+E) | Medium | Graph | Graph Coloring |
Name | Country | Programming Language | Where to find you (add all links to your profiles eg on Hackerrank, Codechef, LeetCode...) |
---|---|---|---|
Gourav R ![]() |
India | Java | codedecks Hackerrank |
Lokendra Bohra ![]() |
India | Python | Leetcode Hackerrank |
Yuri Spiridonov ![]() |
Russia | Python | Twitter Leetcode Hackerrank |
Naveen Kashyap ![]() |
India | Javascript | Twitter Leetcode |
Rudra Mishra ![]() |
India | C++ | Twitter Leetcode |
Sachin Singh Negi ![]() |
India | Python | Twitter Leetcode Hackerrrak |