LeetCode-Solutions
Join Us on Telegram & Facebook
--- ![Language](https://img.shields.io/badge/language-Python%20%2F%20Java%20%2F%20JS%20%2F%20C++-orange.svg) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues) [![Discord](https://img.shields.io/discord/463752820026376202.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/umYVGnvvAg) [![first-timers-only-friendly](http://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat-square)](https://code.publiclab.org#r=all) ### Got stuck in a LeetCode question? ### This repository will help you by providing approach of solving the problems from LeetCode platform. ### [Contributors](#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](https://github.com/codedecks-in/LeetCode-Solutions/blob/master/PULL_REQUEST_PROCESS.md) Check out ---> [Sample PR](https://github.com/codedecks-in/LeetCode-Solutions/pull/3) - 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](https://github.com/codedecks-in/HackerRank-Solutions), [ProjectEuler](https://github.com/codedecks-in/ProjectEuler-Solutions) repositories. - Hope you enjoy the journey of learning data structures and algorithms. - Notes: "🔒" means your subscription of [LeetCode premium membership](https://leetcode.com/subscribe/) is required for reading the question. ### Don't forget to give us a 🌟 to support us. ## Check out -> [Learning Resources](#learning-resources) # Algorithms - [Bit Manipulation](#bit-manipulation) - [Array](#array) - [String](#string) - [Linked List](#linked-list) - [Stack](#stack) - [Queue](#queue) - [Heap](#heap) - [Tree](#tree) - [Hash Table](#hash-table) - [Math](#math) - [Two Pointers](#two-pointers) - [Sort](#sort) - [Recursion](#recursion) - [Binary Search](#binary-search) - [Binary Search Tree](#binary-search-tree) - [Breadth-First Search](#breadth-first-search) - [Depth-First Search](#depth-first-search) - [Backtracking](#backtracking) - [Dynamic Programming](#dynamic-programming) - [Greedy](#greedy) - [Graph](#graph) - [Geometry](#geometry) - [Simulation](#simulation) - [Design](#design) - [Concurrency](#concurrency) # Bit Manipulation | # | Title | Solution | Time | Space | Difficulty | Tag | Tutorial | | ---- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------ | ------ | ---------- | --- | ---------------------------------------- | | 136 | [Single Number](https://leetcode.com/problems/single-number/) | [Java](/LeetCode-Solutions/Java/single-number.java)[Python](/LeetCode-Solutions/Python/single-number.py)
[C++](/LeetCode-Solutions/C++/Single-Number.cpp)
[JavaScript](/LeetCode-Solutions/JavaScript/single-number.js) | _O(n)_ | _O(1)_ | Easy | | Using XOR | | 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [Python](/LeetCode-Solutions/Python/single-number-ii.py)
[C++](/LeetCode-Solutions/C++/Single-Number-II.cpp) | _O(n)_ | _O(1)_ | Medium | | | | 260 | [Single Number III](https://leetcode.com/problems/single-number-iii/) | [Python](/LeetCode-Solutions/Python/single-number-iii.py)
[C++](/LeetCode-Solutions/C++/Single-Number-III.cpp) | _O(n)_ | _O(1)_ | Medium | | | | 371 | [Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [Java](/LeetCode-Solutions/Java/Sum_of_two_integers.java) | _O(1)_ | _O(1)_ | Medium | | 476 | [Number Complement](https://leetcode.com/problems/number-complement/) | [Java](/LeetCode-Solutions/Java/number-complement.java)
[C++](/LeetCode-Solutions/C++/Number-Complement.cpp) | _O(1)_ | _O(1)_ | Easy | | [Tutorial](https://youtu.be/6bp5V-O3zts) | | 520 | [Detect Capital Use](https://leetcode.com/problems/detect-capital/) | [Python](/LeetCode-Solutions/Python/detect-capital.py)
[C++](/LeetCode-Solutions/C++/Detect-Capital.cpp) | _O(n)_ | _O(1)_ | Easy | | | | 1486 | [XOR Operation in an Array](https://leetcode.com/problems/xor-operation-in-an-array/) | [Java](/LeetCode-Solutions/Java/xor-op-in-array.java)
[C++](/LeetCode-Solutions/C++/xor-operation-in-an-array.cpp) | _O(n)_ | _O(1)_ | Easy | | Using XOR |
# Sort | # | Title | Solution | Time | Space | Difficulty | Tag | Tutorial | | --- | --------------------------------------------------------------------------------------- | ------------------------------------------- | ------ | ------ | ---------- | --- | -------- | | 973 | [K Closest Points to Origin](https://leetcode.com/problems/k-closest-points-to-origin/) | [C++](/LeetCode-Solutions/C++/k-closest-points-to-origin.cpp) | _O(n)_ | _O(1)_ | Medium | | |
# Array | # | Title | Solution | Time | Space | Difficulty | Note | Video Explaination | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------ | ------------- | ---------- | ------------------ | ---------------------------------------- | | 118 | [Pascal's Triangle](https://leetcode.com/problems/pascals-triangle/) | [Java](/LeetCode-Solutions/Java/PascalsTriangle118.java) | _O(N^2)_ | _O(N)_ | Easy | | | | 56 | [Merge Intervals](https://leetcode.com/problems/merge-intervals) | [Python](/LeetCode-Solutions/Python/56_MergeIntervals.py) | _O(nlogn)_ | _O(n)_ | Medium | Intervals | | | 268 | [Missing Number](https://leetcode.com/problems/missing-number) | [Java](/LeetCode-Solutions/Java/missing-number.java) | _O(n)_ | _O(1)_ | Easy | Array | [Tutorial](https://youtu.be/VwvGEE_OGss) | | 697 | [Degree of an Array](https://leetcode.com/problems/degree-of-an-array) | [Java](/LeetCode-Solutions/Java/Degree-of-an-Array.java) | _O(n)_ | _O(n)_ | Easy | Array | | | 1089 | [Duplicate Zeroes](https://leetcode.com/problems/duplicate-zeros/) | [JavaScript](/LeetCode-Solutions/JavaScript/Duplicate-Zeroes.js) | _O(n)_ | _O(n)_ | Easy | Array | | | 1502 | [Can Make Arithmetic Progression From Sequence](https://leetcode.com/problems/can-make-arithmetic-progression-from-sequence/) | [Java](/LeetCode-Solutions/Java/can-make-arithmetic-progression-from-sequence.java) | _O(n)_ | _O(1)_ | Easy | Array | | | 122 | [Best Time to buy and sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii) | [Python](/LeetCode-Solutions/Python/best-time-to-buy-and-sell-stock-ii.py)
[C++](/LeetCode-Solutions/C++/Best-Time-to-Buy-and-Sell-Stock-II.cpp) | _O(N)_ | _O(1)_ | Medium | Stocks | | | 119 | [Pascal's Triangle II](https://leetcode.com/problems/pascals-triangle-ii) | [Python](/LeetCode-Solutions/Python/pascals-triangle-ii.py) | _O(N^2)_ | _O(K)_ | Easy | | | | 1480 | [Running Sum of 1d Array](https://leetcode.com/problems/running-sum-of-1d-array/) | [Java](/LeetCode-Solutions/Java/running-sum-of-1d-array.java) | _O(N)_ | _O(N)_ | Easy | Simple sum | | | 42 | [Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/) | [Python](/LeetCode-Solutions/Python/trapping_rain.py) | _O(N^2)_ | _O(N)_ | Hard | Array | | | 11 | [Container with Most Water](https://leetcode.com/problems/container-with-most-water/) | [Python](/LeetCode-Solutions/Python/container_with_most_water.py) | _O(N)_ | _O(N)_ | Medium | Array Two Pointers | | | 1134 🔒 | [Armstrong Number](https://leetcode.com/problems/armstrong-number/) | [Java](/LeetCode-Solutions/Java/Armstrong-Number.java) | _O(N)_ | _O(1)_ | Easy | | | | 1534 | [Count Good Triplets](https://leetcode.com/problems/count-good-triplets/) | [Python](/LeetCode-Solutions/Python/count-good-triplets.py) | _O(N^3)_ | _O(1)_ | Easy | | | | 1572 | [Matrix Diagonal Sum](https://leetcode.com/problems/matrix-diagonal-sum/) | [Java](/LeetCode-Solutions/Java/matrix-diagonal-sum.java) | _O(N)_ | _O(1)_ | Easy | | | | 811 | [Subdomain Visit Count](https://leetcode.com/problems/subdomain-visit-count/) | [Javascript](/LeetCode-Solutions/JavaScript/Subdomain-Visit-Count.js) | _O(N\*M)_ | _O(N\*M + N)_ | Easy | | | | 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [C++](/LeetCode-Solutions/C++/maximum-subarray.cpp) | _O(N)_ | _O(1)_ | Easy | Array | | | 495 | [Teemo Attacking](https://leetcode.com/problems/teemo-attacking) | [C++](/LeetCode-Solutions/C++/teemo-attacking.cpp) | _O(n)_ | _O(1)_ | Medium | Array | | | 15 | [3 Sum](https://leetcode.com/problems/3sum/) | [Python](/LeetCode-Solutions/Python/ThreeNumbersSum.py) | O( nLog(n) ) | O(1) | Medium | Array | | 1200 | [Minimum Absolute Difference](https://leetcode.com/problems/minimum-absolute-difference/) | [Python](./python/SmallestDifference.py) | O(n) | O(1) | Easy | Array | | 532 | [K-diff Pairs in an Array](https://leetcode.com/problems/k-diff-pairs-in-an-array/) | [C++](/LeetCode-Solutions/C++/k-diff-pairs-in-an-array.cpp) | O(n) | O(n) | Medium | Array | | 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [Javascript](/LeetCode-Solutions/JavaScript/152.Maximum-Product-Subarray.js) | O(n) | O(n) | Medium | Array | | 073 | [Set-Matrix-Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [Java](/LeetCode-Solutions/Java/set-matrix-zeroes.java) | O(MN) | O(1) | Medium | Array | | 1288 | [Remove-Covered-Intervals](https://leetcode.com/problems/remove-covered-intervals) | [C++](/LeetCode-Solutions/C++/Remove-Covered-Intervals.cpp) | O(N\*N) | O(1) | Medium | Array | | 189 | [Rotate-Array](https://leetcode.com/problems/rotate-array/) | [Python](/LeetCode-Solutions/Python/rotate-array.py) | O(N) | O(1) | Medium | Array | | 496 | [next-greater-element-i](https://leetcode.com/problems/next-greater-element-i) | [Python](/LeetCode-Solutions/Python/496_nextgreaterelement.py) | O(N) | O(1) | Medium | Array | | 1470 | [Shuffle the Array](https://leetcode.com/problems/shuffle-the-array) | [Java](/LeetCode-Solutions/Java/shuffle-the-array.java) | O(N) | O(1) | Easy | Array | | 124 | [Permutation by Recussion](https://leetcode.com/problems/permutations/) | [Java](/LeetCode-Solutions/Java/shuffle-the-array.java) | O(N) | O(N) | Easy | Array | | 283 | [Move-Zeroes](https://leetcode.com/problems/move-zeroes/) | [C++](/LeetCode-Solutions/C++/Move-Zeroes.cpp) | O(N) | O(1) | Easy | Array | | 27 | [Remove-Element](https://leetcode.com/problems/remove-element/) | [C++](/LeetCode-Solutions/C++/remove-element.cpp) | O(N) | O(1) | Easy | Array | | 36 | [Valid Sudoku](https://leetcode.com/problems/valid-sudoku/) | [Java](/LeetCode-Solutions/Java/valid-sudoku.java) | O(N^2) | O(N) | Medium | Array, 2D Matrix | | 1512 | [Number of Good Pairs](https://leetcode.com/problems/number-of-good-pairs/) | [Java](/LeetCode-Solutions/Java/Number-of-Good-Pairs.java) | O(N^2) | O(1) | Easy | Array | | 162 | [Find Peak element](https://leetcode.com/problems/find-peak-element/) | [javascript](https://github.com/codedecks-in/LeetCode-Solutions/blob/master/JavaScript/findPeakElement.js) | o(Logn) | O(1) | Medium | Array | | 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [C++](/LeetCode-Solutions/C++/Spiral-matrix.cpp) | O(M\*N) | O(M\*N) | Medium | Array | | 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/) | [C++](/LeetCode-Solutions/C++/238.Product_of_array_except_self) | O(N) | O(N) | Medium | Array |
# String | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | :--: | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------ | ------ | ---------- | --- | --------------- | | 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [Python](/LeetCode-Solutions/Python/Longest_Substring_Without_Repeating_Characters.py) | _O(n)_ | _O(n)_ | Medium | `Hash Table`
`Sliding Window` | Open for improvisation, mentioned time and space complexities unconfirmed | | 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | [Java](/LeetCode-Solutions/Java/string-to-integer-atoi.java) | _O(n)_ | _O(1)_ | Medium | | | | 9 | [Palindrome Number](https://leetcode.com/problems/palindrome-number/) | [Java](/LeetCode-Solutions/Java/palindrome-number.java) | _O(n)_ | _O(1)_ | Easy | | | | 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [Java](/LeetCode-Solutions/Java/reverse-words-in-a-string.java) | _O(1)_ | _O(n)_ | Medium | | | | 383 | [Ransom Note](https://leetcode.com/problems/ransom-note/) | [Java](/LeetCode-Solutions/Java/ransom-note.java) | _O(1)_ | _O(n)_ | Easy | | Character Count | | 387 | [First Unique Character in a String](https://leetcode.com/problems/first-unique-character-in-a-string/) | [Java](/LeetCode-Solutions/Java/first-unique-character-in-a-string.java) | _O(n)_ | _O(1)_ | Easy | | Character Count | | 520 | [Detect Capital Use](https://leetcode.com/problems/detect-capital/) | [Java](/LeetCode-Solutions/Java/detect-capital-use.java) | _O(n)_ | _O(1)_ | Easy | | | | 767 | [Reorganize String](https://leetcode.com/problems/reorganize-string/) | [Python](/LeetCode-Solutions/Python/reorganize-string.py) | _O(n)_ | _O(n)_ | Medium | | | | 859 | [Buddy Strings](https://leetcode.com/problems/buddy-strings/) | [Java](/LeetCode-Solutions/Java/buddy-strings.java) | _O(n)_ | _O(1)_ | Easy | | | | 1221 | [Split a String in Balanced Strings](https://leetcode.com/problems/split-a-string-in-balanced-strings/) | [Python](/LeetCode-Solutions/Python/split-a-string-in-balanced-strings.py) | _O(n)_ | _O(1)_ | Easy | | | | 1374 | [Generate a String With Characters That Have Odd Counts](https://leetcode.com/problems/generate-a-string-with-characters-that-have-odd-counts/) | [Java](/LeetCode-Solutions/Java/generate-a-string-with-characters-that-have-odd-counts.java) | _O(n)_ | _O(1)_ | Easy | | | | 1614 | [Maximum Nesting Depth of the Parentheses](https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses/) | [Java](/LeetCode-Solutions/Java/max-nesting-depth-parentheses.java) | _O(n)_ | _O(1)_ | Easy | | |
# Linked List | # | Title | Solution | Time | Space | Difficulty | Tag | Tutorial | | --- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ---------- | ------ | ---------- | ------------------ | ---------------------------------------- | | 002 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [Java](/LeetCode-Solutions/Java/Add-Two-Numbers.java) | _O(n)_ | _O(n)_ | Medium | Math | | | 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [Java](/LeetCode-Solutions/Java/remove-nth-node-from-end-of-list.java) | _O(n)_ | _O(1)_ | Medium | Two pointers | | | 23 | [Merge K sorted lists](https://leetcode.com/problems/merge-k-sorted-lists/) | [C++](/LeetCode-Solutions/C++/merge-k-sorted-lists.cpp) | _O(nlogn)_ | _O(n)_ | Hard | sorting and append | | | 109 | [Convert Sorted List to Binary Search Tree](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/) | [Java](/LeetCode-Solutions/Java/convert-sorted-list-to-binary-search-tree.java) | _O(n)_ | _O(n)_ | Medium | LinkedList | | | 141 | [Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/) | [Java](/LeetCode-Solutions/Java/linked-list-cycle.java) | _O(n)_ | _O(1)_ | Easy | Slow-Fast Pointers | | | 142 | [Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/) | [Java](/LeetCode-Solutions/Java/linked-list-cycle-ii.java)
[C++](/LeetCode-Solutions/C++/Linked-List-Cycle-II.cpp) | _O(n)_ | _O(1)_ | Medium | Slow-Fast Pointers | | | 146 | [LRU Cache](https://leetcode.com/problems/lru-cache/) | [C++](/LeetCode-Solutions/C++/LRU-Cache.cpp)
[Python](/LeetCode-Solutions/Python/LRUCache.py) | _O(1)_ | _O(k)_ | Medium | Hash Map | | | 160 | [Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/) | [Java](/LeetCode-Solutions/Java/intersection-of-two-linked-lists.java) | _O(n)_ | _O(1)_ | Easy | Two Pointers | [Tutorial](https://youtu.be/uozGB0-gbvI) | | 186 | [Middle of the Linked List](https://leetcode.com/problems/middle-of-the-linked-list/) | [Java](/LeetCode-Solutions/Java/middle-of-the-linked-list.java) | _O(n)_ | _O(1)_ | Easy | Two pointers | | 143 | [Reorder List](https://leetcode.com/problems/reorder-list/) | [C++](/LeetCode-Solutions/C++/143.Reorder_List.cpp) | _O(n)_ | _O(n)_ | Medium | Iteration and Stack | | 24 | [Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | [C++](/LeetCode-Solutions/C++/Swap-nodes-in-pairs.cpp) | _O(n)_ | _O(1)_ | Medium | Two pointers |
# Stack | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | ---- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | ------ | ------ | ---------- | ---------------------- | ---- | | 020 | [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | [Python](/LeetCode-Solutions/Python/20_ValidParentheses.py) [C++](./C++/Vlalid_Parentheses.cpp)[Java](/LeetCode-Solutions/Java/20.ValidParentheses.java) | _O(n)_ | _O(n)_ | Easy | Stack | | | 084 | [Largest Rectangle in Histogram](https://leetcode.com/problems/largest-rectangle-in-histogram/) | [C++](/LeetCode-Solutions/C++/Largest-Rectangle-in-Histogram.cpp) | _O(n)_ | _O(n)_ | Hard | Stack | | 150 | [Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/) | [Python](/LeetCode-Solutions/Python/150.EvaluateReversePolishNotation.py)
[Java](/LeetCode-Solutions/Java/evaluate_reverse_polish_notation.java) | _O(n)_ | _O(1)_ | Medium | Stack | | | 1047 | [Remove All Adjacent Duplicates In String](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/) | [C++](/LeetCode-Solutions/C++/remove-all-adjacent-duplicates-in-string.cpp) | _O(n)_ | _O(n)_ | Easy | Stack | | | 682 | [Baseball Game](https://leetcode.com/problems/baseball-game/) | [C++](/LeetCode-Solutions/C++/Baseball-Game.cpp) | _O(n)_ | _O(n)_ | Easy | Stack | | | 1381 | [Design a Stack With Increment Operation](https://leetcode.com/problems/design-a-stack-with-increment-operation/) | [Java](/LeetCode-Solutions/Java/Design-a-Stack-With-Increment-Operation.java) | _O(n)_ | _O(n)_ | Medium | Stack | | | 1598 | [Crawler Log Folder](https://leetcode.com/problems/crawler-log-folder/) | [C++](/LeetCode-Solutions/C++/Crawler-Log-Folder.cpp) | _O(n)_ | _O(n)_ | Easy | Stack | | 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [Python](/LeetCode-Solutions/Python/binary-tree-inorder-traversal.py) | _O(n)_ | _O(n)_ | Medium | Recursion, Binary Tree | | 735 | [Asteroid Collision](https://leetcode.com/problems/asteroid-collision/) | [C++](/LeetCode-Solutions/C++/asteroid-collision.cpp) | _O(n)_ | _O(1)_ | Medium | Stack | | | 394 | [Decode String](https://leetcode.com/problems/decode-string/) | [C++](/LeetCode-Solutions/C++/decode-string.cpp) | _O(n)_ | _O(1)_ | Medium | Stack | | | 921 | [Minimum Add to Make Parentheses Valid](https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/) | [C++](/LeetCode-Solutions/C++/minimum-add-to-make-parentheses-valid.cpp) | _O(n)_ | _O(1)_ | Medium | Stack | | | 32 | [Longest Valid Parentheses](https://leetcode.com/problems/longest-valid-parentheses/) | [Python](.Python/longest-valid-parentheses.py) | _O(n)_ | _O(n)_ | Hard | Stack | | | 1249 | [Minimum Remove to Make Valid Parentheses](https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/) | [C++](/LeetCode-Solutions/C++/minimum-remove-to-make-valid-parentheses.cpp) | _O(n)_ | _O(n)_ | Medium | Stack | |
# Queue | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | --- | ------------------------------------------------------------------------------- | ------------------------------------------------ | ------ | ------ | ---------- | --------------------- | ---- | | 933 | [Number of Recent Calls](https://leetcode.com/problems/number-of-recent-calls/) | [C++](/LeetCode-Solutions/C++/Number-of-Recent-Calls.cpp) | _O(1)_ | _O(1)_ | Easy | Queue, Sliding Window | | 641 | [Design Circular Deque](https://leetcode.com/problems/design-circular-deque/) | [Java](/LeetCode-Solutions/Java/design-circular-deque.java) | _O(n)_ | _O(n)_ | Medium | Queue, Design | | 621 | [Task Scheduler ](https://leetcode.com/problems/task-scheduler/) | [Python](/LeetCode-Solutions/Python/621-Task-Scheduler.py) | _O(n)_ | _O(n)_ | Medium | Queue | | 622 | [Design Circular Queue](https://leetcode.com/problems/design-circular-queue/) | [Python](/LeetCode-Solutions/Python/622-Design-Circular-Queue.py) | _O(n)_ | _O(n)_ | Medium | Queue |
# Tree | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | ---- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ----------- | ----------- | ---------- | ---------------------------------------------- | ---- | | 094 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [Java](/LeetCode-Solutions/Java/binary-tree-inorder-traversal.java)
[Python](./Python/Iterative-Inorder-tree-traversal) | _O(n)_ | _O(logn)_ | Medium | Binary Tree, Stack, HashTable | | | 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [Python](./Python/100.SymmetricTree.py)
[Java](/LeetCode-Solutions/Java/Same-Tree.java) | _O(n)_ | _O(n)_ | Easy | Tree, Depth-first Search | | | 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [Java](/LeetCode-Solutions/Java/symmetric-tree.java)
[Python](/LeetCode-Solutions/Python/101.SymmetricTree.py) | _O(n)_ | _O(n)_ | Easy | Tree, Breadth-first Search, Depth-first Search | | | 144 | [Binary Tree Preorder Traversal](https://leetcode.com/problems/binary-tree-preorder-traversal/) | [Java](/LeetCode-Solutions/Java/binary-tree-preorder-traversal.java) | _O(n)_ | _O(logn)_ | Medium | Binary Tree, Stack | | | 145 | [Binary Tree Postorder Traversal](https://leetcode.com/problems/binary-tree-postorder-traversal/) | [Java](/LeetCode-Solutions/Java/binary-tree-postorder-traversal.java) | _O(n)_ | _O(logn)_ | Hard | Binary Tree, Stack | | | 103 | [ZigZag Level Order](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/) | [JavaScript](/LeetCode-Solutions/JavaScript/Binary-Tree-ZigZag-Traversal.js)
[C++](./C++/binary-tree-preorder-traversal.java) | _O(n)_ | _O(n)_ | Medium | Binary Tree | | | 129 | [Sum Root to Leaf Numbers](https://leetcode.com/problems/sum-root-to-leaf-numbers/) | [Java](/LeetCode-Solutions/Java/sum-root-to-leaf-numbers.java) | _O(n)_ | _O(logn)_ | Medium | Binary Tree, Depth First Search | | | 307 | [Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [Java](/LeetCode-Solutions/Java/Range-Sum-Query-Mutable.java) | _O(logn)_ | _O(n)_ | Medium | Segment Tree | | | 919 | [Complete Binary Tree Inserter](https://leetcode.com/problems/complete-binary-tree-inserter/) | [Java](/LeetCode-Solutions/Java/complete-binary-tree-inserter.java) | _O(n)_ | _O(n)_ | Medium | Tree | | | 124 | [Binary Tree Maximum Path Sum](https://leetcode.com/problems/binary-tree-maximum-path-sum/) | [C++](/LeetCode-Solutions/C++/Binary-Tree-Maximum-Path-Sum.cpp) | _O(n)_ | _O(n)_ | Hard | Tree | | | 1028 | [Recover a Tree From Preorder Traversal](https://leetcode.com/problems/recover-a-tree-from-preorder-traversal/) | [C++](/LeetCode-Solutions/C++/Recover-a-Tree-From-Preorder-Traversal.cpp) | _O(n)_ | _O(n)_ | Hard | Tree | | | 968 | [Binary Tree Cameras](https://leetcode.com/problems/binary-tree-cameras/) | [C++](/LeetCode-Solutions/C++/Binary-Tree-Cameras.cpp) | _O(n)_ | _O(logn)_ | Hard | Binary Tree, Dynamic Programming | | 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [Javascript](/LeetCode-Solutions/JavaScript/98.Validate-Binary-Search-Tree.js) | _O(log(n))_ | _O(log(n))_ | Medium | Binary Tree | | 684 | [Redundant Connection](https://leetcode.com/problems/redundant-connection/) | [Java](/LeetCode-Solutions/Java/Redundant-Connection/redundant-connection.java) | _O(N)_ | _O(N)_ | Medium | Tree, Union Find | | 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) |[C++](/LeetCode-Solutions/C++/Binary-Tree-Level-Order-Traversal.cpp)| _O(n)_ | _O(n)_ | Medium | Binary Tree, map | |
# Hash Table | # | Title | Solution | Time | Space | Difficulty | Tag | Video Explanation | | --- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ----------- | ------ | ---------- | --- | ------------------------------------------------------- | | 001 | [Two Sum](https://leetcode.com/problems/two-sum/) | [Java](/LeetCode-Solutions/Java/two-sum.java)
[Python](/LeetCode-Solutions/Python/1_TwoSum.py)
[C++](/LeetCode-Solutions/C++/two-sum.cpp) | _O(N)_ | _O(N)_ | Easy | | [Tutorial](https://youtu.be/47xMuvwP7zQ) | | 242 | [Valid Anagram](https://leetcode.com/problems/valid-anagram/) | [Java](/LeetCode-Solutions/Java/valid-anagram.java) | _O(n)_ | _O(1)_ | Easy | | [Tutorial](https://www.youtube.com/watch?v=sbX1Ze9lNQE) | | 146 | [LRU Cache](https://leetcode.com/problems/lru-cache/) | [Java](/LeetCode-Solutions/Java/LRU-Cache.java) | | | Medium | | | | 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [Python](/LeetCode-Solutions/Python/contains-duplicate.py) | _O(n)_ | _O(n)_ | | | | 554 | [Brick Wall](https://leetcode.com/problems/brick-wall/) | [C++](./C++/brick-walls.cpp) | _O(n)_ | _O(n)_ | Medium | | | 049 | [Group Anagrams](https://leetcode.com/problems/group-anagrams/) | [Python](/LeetCode-Solutions/Python/group_anagram.py) | _O(nlogn)_ | _O(1)_ | Easy | | | 554 | [Brick Wall](https://leetcode.com/problems/brick-wall/) | [C++](./C++/brick-walls.cpp) | _O(n)_ | _O(n)_ | Medium | | | 146 | [LRU Cache](https://leetcode.com/problems/lru-cache/) | [Javascript](../JavaScript/146.LRU-Cache.js) | _O(log(n))_ | _O(n)_ | Medium | | | 389 | [Find The Difference](https://leetcode.com/problems/find-the-difference/) | [C++](../C++/Find-The-Difference.cpp) | _O(n)_ | _O(1)_ | Easy | |
# Two Pointers | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | --- | --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------- | ------------------ | ---------- | ----------- | ---------------- | | 005 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [Python](/LeetCode-Solutions/Python/5_LongestPalindromicSubstring.py)
[JavaScript](/LeetCode-Solutions/JavaScript/5.Longest-Palindromic-Substring.js) | _O(N^2)_
_O(N^2)_ | _O(N)_
_O(1)_ | Medium | | Expand the Wings | | 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [Java](/LeetCode-Solutions/Java/median-of-two-sorted-arrays.java) | _O(log(min(m,n)))_ | _O(1)_ | Hard | | | | 845 | [Longest Mountain in Array](https://leetcode.com/problems/longest-mountain-in-array/) | [C++](/LeetCode-Solutions/C++/Longest-Mountain-in-Array.cpp) | _O(N)_ | _O(1)_ | Medium | Two Pointer | | 015 | [3 Sum](https://leetcode.com/problems/3sum/) | [C++](/LeetCode-Solutions/C++/3sum.cpp) | _O(N)_ | _O(1)_ | Medium | Two Pointer | | | 021 | [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/) | [C++](/LeetCode-Solutions/C++/Longest-Mountain-in-Array.cpp) | _O(N)_ | _O(1)_ | Easy | Two Pointer | |
# Math | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | --- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ----------------- | ------ | ---------- | ------ | ------------- | | 050 | [Pow(x, n)](https://leetcode.com/problems/powx-n/) | [Python](/LeetCode-Solutions/Python/50.Powxn.py)
[JavaScript](/LeetCode-Solutions/JavaScript/50.Powxn.js) | _O(n)_ | _O(1)_ | Medium | Math | | | 204 | [Count Primes](https://leetcode.com/problems/count-primes) | [C++](/LeetCode-Solutions/C++/Count-Primes.cpp) | _O(n(log(logn)))_ | _O(n)_ | Easy | Math | | | 171 | [Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number/) | [C++](/LeetCode-Solutions/C++/Excel-Sheet-Column-Number.cpp) | _O(n)_ | _O(1)_ | Easy | String | | | 168 | [Excel Sheet Column Title](https://leetcode.com/problems/excel-sheet-column-title) | [C++](/LeetCode-Solutions/C++/Excel-Sheet-Column-Title.cpp) | _O(n)_ | _O(n)_ | Easy | String | | | 007 | [Reverse Integer](https://leetcode.com/problems/reverse-integer) | [Java](/LeetCode-Solutions/Java/reverse-integer.java)
[C++](/LeetCode-Solutions/C++/Reverse-Integer.cpp) | _O(n)_ | _O(n)_ | Easy | Math | | | 202 | [Happy Number](https://leetcode.com/problems/happy-number) | [Java](/LeetCode-Solutions/Java/Happy-Number.java) | _O(n^2)_ | _O(n)_ | Easy | Math | | | 326 | [Power of Three](https://leetcode.com/problems/power-of-three) | [Java](/LeetCode-Solutions/Java/Power-of-Three.java) | _O(logn)_ | _O(n)_ | Easy | Math | | | 12 | [Integer to Roman](https://leetcode.com/problems/integer-to-roman) | [Java](/LeetCode-Solutions/Java/integer-to-roman.java) | _O(n)_ | _O(1)_ | Medium | Math | | | 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer) | [Java](/LeetCode-Solutions/Java/roman-to-integer.java)
[C++](/LeetCode-Solutions/C++/Roman_to_Integer.cpp)| _O(n)_ | _O(1)_ | Easy | Math | | | 14 | [Arithmetic Subarrays](https://leetcode.com/problems/arithmetic-subarrays/) | [Java](/LeetCode-Solutions/Java/Arithmetic-Subarrays.java) | _O(m\*n)_ | _O(n)_ | Medium | Math | Pattern Count | | 263 | [Ugly Number](https://leetcode.com/problems/ugly-number/) | [Java](/LeetCode-Solutions/Java/Ugly-Number.java) | _O(n)_ | _O(n)_ | Easy | Math | | | 412 | [Fizz Buzz](https://leetcode.com/problems/fizz-buzz/) | [Java](/LeetCode-Solutions/Java/FizzBuzz.java) | _O(n)_ | _O(n)_ | Easy | Math | | | 1518 | [Water Bottles](https://leetcode.com/problems/water-bottles/) | [Java](/LeetCode-Solutions/Java/WaterBottles.java) | _O(n)_ | _O(n)_ | Easy | Math | | | 1822 | [Sign Of Product](https://leetcode.com/problems/sign-of-the-product-of-an-array/) | [Java](/LeetCode-Solutions/Java/SignOf.java) | _O(n)_ | _O(n)_ | Easy | Math | | | 991 | [Broken Calculator](https://leetcode.com/problems/broken-calculator/) | [Java](/LeetCode-Solutions/Java/BrokenCalculator.java) | _O(n)_ | _O(n)_ | Medium | Math | | | 1837 | [Sum of Digits in Base K](https://leetcode.com/problems/sum-of-digits-in-base-k/) | [Python](/LeetCode-Solutions/Python/baseK.py) | _O(n)_ | _O(1)_ | Easy | Math | |
# Breadth-First Search | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------- | ----------------- | ---------- | --- | ---- | | 1284 | [Minimum Number of Flips to Convert Binary Matrix to Zero Matrix](https://leetcode.com/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/) | [C++](/LeetCode-Solutions/C++/Minimum-Number-of-Flips-to-Convert-Binary-Matrix-to-Zero-Matrix.cpp) | _O(m * n * 2 ^ (m \* n))_ | _O(2 ^ (m \* n))_ | Hard | BFS | | | 200 | [Number of Islands](https://leetcode.com/problems/number-of-islands/) | [Java](/LeetCode-Solutions/Java/NumberOfIslands.java) | O(R \* C) | O(R \* C) | Medium | BFS | | 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [Java](/LeetCode-Solutions/Java/word-ladder.java) | O(N^2 \* M) | O(N \* M) | Medium | BFS | | 994 | [Rotten Oranges](https://leetcode.com/problems/rotting-oranges/) | [Python](/LeetCode-Solutions/Python/994_Rotting_Oranges.py) | O(N \* M) | O(N \* M) | Medium | BFS | | 743 | [Network Delay Time](https://leetcode.com/problems/network-delay-time/) | [C++](/LeetCode-Solutions/C++/Network-delay-time.cpp) | _O(V+E))_ | O(V) | Medium | BFS | | 111 | [Min Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](/LeetCode-Solutions/JavaScript/111-minimum-depth-of-binary-tree.js) | O(nlogn) | O(nlogn) | Easy | BFS | | 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [C++](https://github.com/codedecks-in/LeetCode-Solutions/blob/master/C%2B%2B/100_Same_Tree.cpp) | O(N) | O(N) | Easy | BFS |
# Depth-First Search | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | ---- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | ----------- | ----------- | ---------- | --- | ---- | | 1463 | [Cherry Pickup II](https://leetcode.com/problems/cherry-pickup-ii/) | [C++](/LeetCode-Solutions/C++/Cherry-Pickup-II.cpp) | _O(n \* m)_ | _O(n \* m)_ | Hard | DFS | | | 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [python](/LeetCode-Solutions/Python/maximum-depth-of-binary-tree.py) | _O(n)_ | _O(n)_ | Easy | DFS | | | 112 | [Path Sum](https://leetcode.com/problems/path-sum/) | [Java](/LeetCode-Solutions/Java/path-sum.java) | _O(n)_ | _O(n)_ | Easy | DFS | | | 110 | [Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree/) | [Java](/LeetCode-Solutions/Java/Balanced-Binary-Tree.java) | _O(n)_ | _O(n)_ | Easy | DFS | | | 1376 | [ Time Needed to Inform All Employees](https://leetcode.com/problems/time-needed-to-inform-all-employees/) | [C++](/LeetCode-Solutions/C++/Cherry-Pickup-II.cpp) | _O(n)_ | _O(n)_ | Medium | DFS | | | 200 | [Number of Islands](https://leetcode.com/problems/number-of-islands/) | [C++](/LeetCode-Solutions/C++/number-of-islands.cpp) | _O(m * n)_ | _O(m * n)_ | Medium | DFS | |
# BackTracking | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | --- | ------------------------------------------------------------------- | --------------------------------- | ------------------------- | ----------- | ---------- | ------------------- | ---- | | 037 | [Sudoku Solver](https://leetcode.com/problems/sudoku-solver/) | [C++](/LeetCode-Solutions/C++/Sudoku-Solver.cpp) | _O(n^2)_ | _O(1)_ | Hard | Hash Table | | | 980 | [Unique Paths III](https://leetcode.com/problems/unique-paths-iii/) | [C++](/LeetCode-Solutions/C++/Unique-Paths-III.cpp) | _O(R * C * 2 ^ (R \* C))_ | _O(R \* C)_ | Hard | DFS, Memoization | | | 39 | [Combination Sum](https://leetcode.com/problems/combination-sum/) | [C++](/LeetCode-Solutions/C++/combination-sum.cpp) | _O(2^n)_ | _O(n)_ | Medium | Array, Backtracking | | | 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [C++](/LeetCode-Solutions/C++/letter-combinations-of-a-phone-number.cpp) | _O(4^n)_ | _O(n)_ | Medium | String, Hash Table, Backtracking | |
# Dynamic Programming | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | ---- | ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | --------- | --------- | ---------- | -------------------- | ---- | | 416 | [ Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [C++](/LeetCode-Solutions/C++/Partition-Equal-Subset-Sum.cpp) | _O(n^2)_ | _O(n^2)_ | Medium | DP | | | 056 | [Wildcard Matching](https://leetcode.com/problems/wildcard-matching/) | [Python](/LeetCode-Solutions/Python/wildcard-matching.py) | _O(n^2)_ | _O(n^2)_ | Hard | | | 343 | [Integer Break](https://leetcode.com/problems/integer-break/) | [C++](/LeetCode-Solutions/C++/Integer-Break.cpp) | _O(n^2)_ | _O(n)_ | Medium | | | 139 | [Word Break](https://leetcode.com/problems/word-break/) | [Python](/LeetCode-Solutions/Python/word-break-1.py) | _O(n^3)_ | _O(n)_ | Medium | DP | | | 1092 | [Shortest Common Supersequence](https://leetcode.com/problems/shortest-common-supersequence/) | [C++](/LeetCode-Solutions/C++/Shortest-Common-Supersequence.cpp) | _O(n^2)_ | _O(n^2)_ | Hard | DP | | | 72 | [Edit Distance](https://leetcode.com/problems/edit-distance/) | [Python](/LeetCode-Solutions/Python/edit-distance.py) | _O(N\*M)_ | _O(n^2)_ | Medium | Levenshtein Distance | | | 91 | [Decode ways](https://leetcode.com/problems/decode-ways/) | [Python](/LeetCode-Solutions/Python/decode-ways.py) | _O(N)_ | _O(N)_ | Easy | DP | | | 1025 | [Divisor Game](https://leetcode.com/problems/divisor-game/) | [Python](/LeetCode-Solutions/Python/divisor-game.py) | _O(N^2)_ | _O(N)_ | Easy | DP | | | 174 | [Dungeon Game](https://leetcode.com/problems/dungeon-game/) | [C++](./C++/dungeon-game.pp) | _O(M\*N)_ | _O(M\*N)_ | Hard | Dynamic Programming | | | 070 | [Climbing Stairs](https://leetcode.com/problems/climbing-stairs/) | [Java](/LeetCode-Solutions/Java/climbing-stairs.java) | _O(N)_ | _O(1)_ | Easy | DP | | | 730 | [Count Different Palindromic Subsequences](https://leetcode.com/problems/count-different-palindromic-subsequences/) | [C++](/LeetCode-Solutions/C++/Count-Different-Palindromic-Subsequences.cpp) | _O(N\*N)_ | _O(N\*N)_ | Hard | DP | | | 55 | [Jump Game](https://leetcode.com/problems/jump-game/) | [Python](/LeetCode-Solutions/Python/jumpGame.py) | _O(N)_ | _O(N)_ | Medium | DP | |
# Binary Search | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | --- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | --------- | ------ | ---------- | --- | ------------- | | 035 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [Python](/LeetCode-Solutions/Python/35.SearchInsertPosition.py) | _O(logn)_ | _O(1)_ | Easy | | Binary Search | | 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [Java](/LeetCode-Solutions/Java/May-LeetCoding-Challenge/Day-1-First-Bad-Version.java)
[JavaScript](/LeetCode-Solutions/JavaScript/First-Bad-Version.js) | _O(logn)_ | _O(1)_ | Easy | | Binary Search | | 033 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [Python](/LeetCode-Solutions/Python/search-in-rotated-sorted-array.py) | _O(logn)_ | _O(1)_ | Medium | | Binary Search | | 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [Python](/LeetCode-Solutions/Python/find-minimum-in-rotated-sorted-array.py) | _O(logn)_ | _O(1)_ | Medium | | Binary Search | | 704 | [Binary Search](https://leetcode.com/problems/binary-search/) | [C++](/LeetCode-Solutions/C++/BinarySearch.cpp) | _O(logn)_ | _O(1)_ | Easy | | Binary Search |
# Graph | # | Title | Solution | Time | Space | Difficulty | Tag | Note | | ---- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | --------------- | --------- | ---------- | ----- | --------------------------------- | | 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [C++](/LeetCode-Solutions/C++/Course-Schedule.cpp) | _O(V+E)_ | _O(V+E)_ | Medium | Graph | Cycle Detection in Directed Graph | | 1042 | [Flower Planting with No Adjacent](https://leetcode.com/problems/flower-planting-with-no-adjacent/) | [Python](/LeetCode-Solutions/Python/1042_FlowerPlantingwithNoAdjacent.py) | _O(V+E)_ | _O(2V+E)_ | Medium | Graph | Graph Coloring | | 797 | [All Paths From Source to Target](https://leetcode.com/problems/all-paths-from-source-to-target/) | [Java](/LeetCode-Solutions/Java/All_Paths_From_Source_to_Target.java) | _O(N^2)_ | _O(N)_ | Medium | Graph | DFS | | 934 | [Shortest Bridge](https://leetcode.com/problems/shortest-bridge/) | [C++](/LeetCode-Solutions/C++/Shortest-Bridge.cpp) | _O(V)_ | _O(V)_ | Medium | Graph | DFS + BFS | | 1192 | [Critical Connections in a Network](https://leetcode.com/problems/critical-connections-in-a-network/) | [C++](/LeetCode-Solutions/C++/Critical-Connections-in-a-Network.cpp) | _O(V+E)_ | _O(4V+E)_ | Hard | Graph | Tarjan's Algorithm | | 113 | [Path Sum II](https://leetcode.com/problems/path-sum-ii/) | [C++](./C++/Critical-Path-Sum-II.cpp) | _O(V+E)_ | _O(V)_ | Medium | Graph | DFS | | 785 | [Is Graph Bipartite?](https://leetcode.com/problems/is-graph-bipartite/) | [C++](/LeetCode-Solutions/C++/Is-Graph-Bipartite.cpp) | _O(V+E)_ | _O(V)_ | Medium | Graph | BFS | | 947 | [Most Stones Removed with Same Row or Column](https://leetcode.com/problems/most-stones-removed-with-same-row-or-column/) | [C++](/LeetCode-Solutions/C++/Most-Stones-Removed-with-Same-Row-or-Column.cpp) | _O(V)_ | _O(2V)_ | Medium | Graph | Union Find | | [C++](/LeetCode-Solutions/C++/Most-Stones-Removed-with-Same-Row-or-Column.cpp) | _O(V)_ | _O(2V)_ | Medium | Graph | Union Find | | 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [C++](/LeetCode-Solutions/C++/Course-Schedule-II.cpp) | _O(V+E)_ | _O(V)_ | Medium | Graph | BFS | | 1627 | [Graph Connectivity with Threshold](https://leetcode.com/problems/graph-connectivity-with-threshold/) | [Java](/LeetCode-Solutions/Java/graph_connectivity_with_threshold.java) | _O(V.logV + Q)_ | _O(V)_ | Hard | Graph | Union Find + Sieve | | 1631 | [Path with Minimum Effort](https://leetcode.com/problems/path-with-minimum-effort/) | [Java](/LeetCode-Solutions/Java/path-with-minimum-effort.java) | _O(V^2)_ | _O(V)_ | Medium | Graph | Dijkstra's Shortest Path |
# Learning Resources codedecks 1.) [Cracking the Coding Interview (Indian Edition)](https://amzn.to/2H0dHy6) 2.) [Data Structures and Algorithms Made Easy in Java](https://amzn.to/33YqWbT) 3.) [Data Structure and Algorithmic Thinking with Python](https://amzn.to/3lz22p4) 4.) [Head First Design Patterns](https://amzn.to/37426Jk) 5.) [Dynamic Programming for Coding Interviews](https://amzn.to/3jVSPqu) DISCLAIMER: This above mentioned resources have affiliate links, which means if you buy one of the product from my links, I’ll receive a small commission. This helps support the channel and allows us to continue to add more tutorial. Thank you for the support!
## Authors - | [Gourav Rusiya](https://github.com/GouravRusiya30/)
## Contributors | Name | Country | Programming Language | Where to find you
(add all links to your profiles eg on Hackerrank, Codechef, LeetCode...) | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Gourav R](https://github.com/GouravRusiya30/)
| India | Java | [codedecks](https://www.youtube.com/c/codedecks/)
[Hackerrank](https://www.hackerrank.com/gouravrusiya786)
[LeetCode](https://leetcode.com/rusiya/) | | [Dima Vishnevetsky](https://github.com/dimshik100)
| Israel | JavaScript | [Twitter](https://twitter.com/dimshik100)
[Facebook](https://www.facebook.com/dimshik) | | [Anuj Sharma](https://github.com/Optider/)
| India | Python | [Github](https://github.com/Optider) | | [Lokendra Bohra](https://github.com/lokendra1704/)
| India | Python | [Leetcode](https://t.co/u0OByxhcHA)
[Hackerrank](https://www.hackerrank.com/lokendra17) | | [Yuri Spiridonov](https://github.com/YuriSpiridonov)
| Russia | Python | [Twitter](https://twitter.com/YuriSpiridonov)
[Leetcode](https://leetcode.com/yurispiridonov/)
[Hackerrank](https://www.hackerrank.com/YuriSpiridonov) | | [Naveen Kashyap](https://github.com/naveenkash)
| India | Javascript | [Twitter](https://twitter.com/naveen_kashyapp)
[Leetcode](https://leetcode.com/naveenkash/) | | [Rudra Mishra](https://github.com/Rudra407)
| India | C++ | [Twitter](https://twitter.com/ruDra_Mishra407)
[Leetcode](https://leetcode.com/rudramishra/) | | [Sachin Singh Negi](https://github.com/sachinnegi)
| India | Python | [Twitter](https://twitter.com/SachinSinghNe17)
[Leetcode](https://leetcode.com/negisachin688/)
[Hackerrrak](https://www.hackerrank.com/negisachin688) | | [Girish Thatte](https://github.com/girishgr8/)
| India | Java | [Leetcode](https://leetcode.com/girish13/)
[Hackerrank](https://www.hackerrank.com/procoder_13)
[Codechef](https://www.codechef.com/procoder_13) | | [Kevin Chittilapilly](https://github.com/KevinChittilapilly)
| India | Java | [Leetcode](https://leetcode.com/being_kevin/)
[Hackerrank](https://www.hackerrank.com/ckevinvarghese11)
[Kaggle](https://www.kaggle.com/kevinchittilapilly) | | [Nour Grati](https://github.com/Nour-Grati)
| Tunisia | Python | [Leetcode](https://leetcode.com/nourgrati/)
[Hackerrank](https://www.hackerrank.com/noor_grati)
[Twitter](https://twitter.com/GratiNour1) | | [Avinash Trivedi](https://github.com/trivediavinash)
| India | C++ | [Leetcode](https://leetcode.com/avi_002/) | | [Ishika Goel](https://github.com/ishikagoel5628)
| India | C++ | [Leetcode](https://leetcode.com/ishikagoel5628/) | | [Fenil Dobariya](https://github.com/ifenil)
| India | Java | [Github](https://github.com/ifenil) | | [Prashansa Tanwar](https://github.com/prashansatanwar)
| India | C++ | [Leetcode](https://leetcode.com/prashansaaa/) | | [Ishu Raj](https://github.com/ir2010)
| India | C++ | [Leetcode](https://leetcode.com/ishuraj2010/) | | [Rakesh Bhadhavath](https://github.com/Revenge-Rakesh)
| India | Java | [Leetcode](https://leetcode.com/goal_cracker/) | | [Tarun Singh](https://github.com/TarunSingh56)
| India | C++ | [Leetcode](https://leetcode.com/_tarun/) | | [Hardik Gupta](https://github.com/harrdy272)
| India | C++ | [codeforces](https://codeforces.com/profile/harrdy272)
[codechef](https://www.codechef.com/users/hardikg272)
[Hackerrank](https://www.hackerrank.com/hardikg272)
[LeetCode](https://leetcode.com/hardikg272/) | | [Jaseem ck](https://github.com/Jaseemck)
| India | Python | [Github](https://github.com/Jaseemck) | | [Ilias Khan](https://github.com/IliasKhan)
| India | C++ | [codechef](https://www.codechef.com/users/iliaskhan)
[Hackerrank](ckerrank.com/iliaskhan57)
[LeetCode](https://leetcode.com/ilias_khan/)
[codeforces](http://codeforces.com/profile/iliaskhan) | | [Shamoyeeta Saha](https://github.com/Shamoyeeta)
| India | C++ | [Hackerrank](https://www.hackerrank.com/sahashamoyeeta)
[Github](https://github.com/Shamoyeeta) | | [James Y](https://github.com/jameszu)
| New Zealand | python | [Github](https://github.com/jameszu) | | [Hamza B](https://github.com/9Hamza)
| Saudi Arabia | Java | [Github](https://github.com/9Hamza) | | [Meli Haktas](https://github.com/MercerFrey)
| Turkey | python | [Github](https://github.com/MercerFrey) | | [Saurav Prateek](https://github.com/SauravP97)
| India | Java | [Github](https://github.com/SauravP97)
[Codechef](https://www.codechef.com/users/srvptk)
[Codeforces](https://codeforces.com/profile/srvptk97)
[Leetcode](https://leetcode.com/srvptk97) | | [Anushka Verma](https://github.com/verma-anushka)
| India | C++ | [Portfolio](https://verma-anushka.github.io/anushkaverma/)
[LeetCode](https://leetcode.com/anushka_verma/) | | [James H](https://github.com/HoangJames)
| United Kingdom | C++ | [Github](https://github.com/HoangJames) | | [Franchis N. Saikia](https://github.com/Francode007)
| India | C++ | [Github](https://github.com/Francode007) | | [Yarncha](https://github.com/yarncha)
| South Korea | C++ | [LeetCode](https://leetcode.com/yamcha/) | | [Gamez0](https://github.com/Gamez0)
| South Korea | Python | [LeetCode](https://leetcode.com/Gamez0/) | | [JeongDaHyeon](https://github.com/JeongDaHyeon)
| South Korea | Java | [GitHub](https://github.com/JeongDaHyeon) | | [Aysia](https://www.linkedin.com/in/aysiaelise/)
| USA | JavaScript | [GitHub](https://github.com/aysiae) | | [Poorvi Garg](https://github.com/POORVI111)
| India | C++ | [GitHub](https://github.com/POORVI111) | | [Lakshmanan Meiyappan](https://laxmena.com)
| India | C++ | [Website - Blog](https://laxmena.com)
[GitHub](https://github.com/laxmena)
[LinekdIn](https://www.linkedin.com/in/lakshmanan-meiyappan/) | | [Sachin_Upadhyay](https://github.com/sachsbu)
| India | Java | [GitHub](https://github.com/sachsbu) | [Amisha Sahu](https://github.com/Amisha328)
| India | C++ | [CodeChef](https://www.codechef.com/users/amisha328)
[LeetCode](https://leetcode.com/Mishi328/)
[HackerRank](https://www.hackerrank.com/amishasahu328) | [Shrimadh V Rao](https://github.com/Shrimadh)
| India | C++ | [GitHub](https://github.com/Shrimadh) | [Shreyas Shrawage](https://github.com/shreyventure)
| India | Python | [CodeChef](https://www.codechef.com/users/shreyventure)
[LeetCode](https://leetcode.com/shreyventure/)
[HackerRank](https://www.hackerrank.com/shreyas_shrawage) | [Surbhi Mayank](https://github.com/surbhi2408)
| India | C++ | [GitHub](https://github.com/surbhi2408)