`** (e.g. `java/1-Two-Sum.java`)
+ - *Note: This is subject to change in the future, as [described in this issue](https://github.com/neetcode-gh/leetcode/issues/457#issuecomment-1233558291)*
+- **Give your PR a succinct and accurate title** (e.g. _"Create: 1-Two-Sum.py"_)
+- Prefer **one solution/change per PR** (not a hard and fast rule, but will typically make the review cycle shorter)
+- **Follow the** [PR template](./.github/pull_request_template.md) and add additional information when needed
+- **Make sure your code passes** submission on [leetcode.com](https://leetcode.com) for the problem it solves
+- **Write clean code** (Your code should use semantically meaningful variable/method names, consistent style, etc) and easy to understand. for example, a single letter is probably not a semantically meaningful name
+- **Ensure the problem is not already solved** in the language you're contributing in
+
+## FAQs
+
+**Q:** What should my solution include?
+
+**A:** You can keep your solution exactly the same as the one you submit to leetcode, you don't need to write tests or your own implementation of leetcode's built-ins.
+##
+
+**Q:** What if there are multiple ways to solve the problem?
+
+**A:** Multiple solutions to the same problem are accepted (as long as they differ in approach or time/memory complexity), although the first solution should always follow the same algorithm shown on [the channel](https://www.youtube.com/c/neetcode). Please make sure distinct solutions are grouped together in the same file, with appropriately differentiating names (e.g. `isValidBstIterative` and `isValidBstRecursive`)
+##
+
+**Q:** What if my solution has a lower runtime but the same time/memory complexity?
+
+**A:** Leetcode's runtime measurement can be severely inaccurate varying based on server load, time of day and many other factors. In general, readability and clarity of the code (in the context of interviews) are features more important than performance gains, however changes that transparently improve performance will be accepted.
+##
+
+**Q:** What if the problem I want to add isn't in the Neetcode 150 list or Missing Solutions table?
+
+**A:** Questions outside of the Neetcode 150 list can be added but please prioritise adding the listed solutions first.
+##
+
+Thanks for contributing 🚀
diff --git a/out/production/leetcode_Contribution/LICENSE b/out/production/leetcode_Contribution/LICENSE
new file mode 100644
index 000000000..144c6f237
--- /dev/null
+++ b/out/production/leetcode_Contribution/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 neetcode-gh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/out/production/leetcode_Contribution/README.md b/out/production/leetcode_Contribution/README.md
new file mode 100644
index 000000000..90076acab
--- /dev/null
+++ b/out/production/leetcode_Contribution/README.md
@@ -0,0 +1,429 @@
+# Leetcode solutions for 🚀 [NeetCode.io](https://neetcode.io)
+> This repo hosts the solutions found on [NeetCode.io](https://neetcode.io) including the solutions shown on the [NeetCode YouTube channel](https://www.youtube.com/c/neetcode). The site will periodically be updated with new solutions from this repo!
+
+
+
+Solutions from these languages will be linked from [NeetCode.io](https://neetcode.io):
+* Python
+* C++
+* Java
+* Javascript
+
+Solutions are also welcome for any other *supported* language on leetcode.com!
+
+## Contributing
+**Please read the [contributing guidlines](./CONTRIBUTING.md) before opening a PR**
+
+
+To contribute, please fork this repo and open a PR adding a [missing solution](#missing-solutions) from the supported languages.
+
+If you would like to have collaborator permissions on the repo to merge your own PRs or review others' PRs please let me know.
+
+## Credits
+
+
+
+
+
+## Missing Solutions
+
+### Arrays & Hashing
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[217 - Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [✔️](c%2F217-Contains-Duplicate.c)
| [✔️](cpp%2F217-Contains-Duplicate.cpp)
| [✔️](csharp%2F217-Contains-Duplicate.cs)
| [✔️](go%2F217-Contains-Duplicate.go)
| [✔️](java%2F217-Contains-Duplicate.java)
| [✔️](javascript%2F217-Contains-Duplicate.js)
| [✔️](kotlin%2F217-Contains-Duplicate.kt)
| [✔️](python%2F217-Contains-Duplicate.py)
| [✔️](ruby%2F217-Contains-Duplicate.rb)
| [✔️](rust%2F217-Contains-Duplicates.rs)
| [✔️](scala%2F217-Contains-Duplicate.scala)
| [✔️](swift%2F217-Contains-Duplicate.swift)
| [✔️](typescript%2F217-Contains-Duplicate.ts)
+[242 - Valid Anagram](https://leetcode.com/problems/valid-anagram/) | [✔️](c%2F242-Valid-Anagram.c)
| [✔️](cpp%2F242-Valid-Anagram-Hashmap.cpp)
| [✔️](csharp%2F242-Valid-Anagram.cs)
| [✔️](go%2F242-Valid-Anagram.go)
| [✔️](java%2F242-Valid-Anagram.java)
| [✔️](javascript%2F242-Valid-Anagram.js)
| [✔️](kotlin%2F242-Valid-Anagram.kt)
| [✔️](python%2F242-Valid-Anagrams.py)
| [✔️](ruby%2F242-Valid-Anagrams.rb)
| [✔️](rust%2F242-Valid-Anagram.rs)
| ❌
| [✔️](swift%2F242-Valid-Anagram.swift)
| [✔️](typescript%2F242-Valid-Anagram.ts)
+[1299 - Replace Elements With Greatest Element On Right Side](https://leetcode.com/problems/replace-elements-with-greatest-element-on-right-side/) | [✔️](c%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.c)
| [✔️](cpp%2F1299-Replace-Elements-with-Greatest-Element-on-Right-Side.cpp)
| [✔️](csharp%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.cs)
| [✔️](go%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.go)
| [✔️](java%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.java)
| [✔️](javascript%2F1299-Replace-Elements-with-Greatest-Element-on-Right-Side.js)
| ❌
| [✔️](python%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.py)
| ❌
| [✔️](rust%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.rs)
| ❌
| ❌
| [✔️](typescript%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.ts)
+[392 - Is Subsequence](https://leetcode.com/problems/is-subsequence/) | [✔️](c%2F392-Is-Subsequence.c)
| [✔️](cpp%2F392-Is-Subsequence.cpp)
| [✔️](csharp%2F392-Is-Subsequence.cs)
| ❌
| [✔️](java%2F392-Is-Subsequence.java)
| [✔️](javascript%2F392-Is-Subsequence.js)
| ❌
| [✔️](python%2F392-Is-Subsequence.py)
| ❌
| [✔️](rust%2F392-Is-Subsequence.rs)
| ❌
| ❌
| [✔️](typescript%2F392-Is-Subsequence.ts)
+[58 - Length of Last Word](https://leetcode.com/problems/length-of-last-word/) | [✔️](c%2F58-Length-Of-Last-Word.c)
| [✔️](cpp%2F58-Length-of-Last-Word.cpp)
| [✔️](csharp%2F58-Length-of-Last-Word.cs)
| ❌
| [✔️](java%2F58-Length-Of-Last-Word.java)
| [✔️](javascript%2F58-Length-Of-Last-Word.js)
| ❌
| [✔️](python%2F58-Length-Of-Last-Word.py)
| ❌
| [✔️](rust%2F58-Length-of-Last-Word.rs)
| ❌
| ❌
| [✔️](typescript%2F58-Length-Of-Last-Word.ts)
+[1 - Two Sum](https://leetcode.com/problems/two-sum/) | [✔️](c%2F1-Two-Sum.c)
| [✔️](cpp%2F1-Two-Sum.cpp)
| [✔️](csharp%2F1-Two-Sum.cs)
| [✔️](go%2F1-Two-Sum.go)
| [✔️](java%2F1-Two-Sum.java)
| [✔️](javascript%2F1-Two-Sum.js)
| [✔️](kotlin%2F1-Two-Sum.kt)
| [✔️](python%2F1-Two-Sum.py)
| [✔️](ruby%2F1-Two-Sum.rb)
| [✔️](rust%2F1-Two-Sum.rs)
| [✔️](scala%2F1-Two-Sum.scala)
| [✔️](swift%2F1-Two-Sum.swift)
| [✔️](typescript%2F1-Two-Sum.ts)
+[14 - Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [✔️](c%2F141-Linked-List-Cycle.c)
| [✔️](cpp%2F14-4Sum.cpp)
| [✔️](csharp%2F141-Linked-List-Cycle.cs)
| [✔️](go%2F141-Linked-List-Cycle.go)
| [✔️](java%2F141.%20Linked%20List%20Cycle.java)
| [✔️](javascript%2F14-Longest-Common-Prefix.js)
| [✔️](kotlin%2F141-Linked-List-Cycle.kt)
| [✔️](python%2F14-Longest-Common-Prefix.py)
| [✔️](ruby%2F141-Linked-List-Cycle.rb)
| ❌
| [✔️](scala%2F141-Linked-List-Cycle.scala)
| [✔️](swift%2F141-Linked-List-Cycle.swift)
| [✔️](typescript%2F141-Linked-List-Cycle.ts)
+[49 - Group Anagrams](https://leetcode.com/problems/group-anagrams/) | ❌
| [✔️](cpp%2F49-Group-Anagrams.cpp)
| [✔️](csharp%2F49-Group-Anagrams.cs)
| [✔️](go%2F49-Group-Anagrams.go)
| [✔️](java%2F49-Group-Anagrams.java)
| [✔️](javascript%2F49-Group-Anagrams.js)
| [✔️](kotlin%2F49-Group-Anagrams.kt)
| [✔️](python%2F49-Group-Anagrams.py)
| [✔️](ruby%2F49-Group-Anagrams.rb)
| [✔️](rust%2F49-Group-Anagrams.rs)
| ❌
| [✔️](swift%2F49-Group-Anagrams.swift)
| [✔️](typescript%2F49-Group-Anagrams.ts)
+[118 - Pascals Triangle](https://leetcode.com/problems/pascals-triangle/) | [✔️](c%2F118-Pascals-Triangle.c)
| [✔️](cpp%2F118-Pascals-Triangle.cpp)
| ❌
| ❌
| [✔️](java%2F118-Pascals-Triangle.java)
| [✔️](javascript%2F118-Pascals-Triangle.js)
| ❌
| [✔️](python%2F118-Pascal-Triangle.py)
| ❌
| [✔️](rust%2F118-Pascals-Triangle.rs)
| ❌
| ❌
| [✔️](typescript%2F118-Pascal-Triangle.ts)
+[27 - Remove Element](https://leetcode.com/problems/remove-element/) | [✔️](c%2F27-Remove-Element.c)
| [✔️](cpp%2F271-Encode-And-Decode-Strings.cpp)
| ❌
| [✔️](go%2F27-Remove-Element.go)
| [✔️](java%2F27-Remove-Element.java)
| [✔️](javascript%2F27-Remove-Element.js)
| ❌
| [✔️](python%2F27-Remove-Element.py)
| [✔️](ruby%2F271-Encode-and-Decode-Strings.rb)
| [✔️](rust%2F271-Encode-And-Decode-Strings.rs)
| ❌
| [✔️](swift%2F271-Encode-and-Decode-Strings.swift)
| [✔️](typescript%2F27-Remove-Element.ts)
+[929 - Unique Email Addresses](https://leetcode.com/problems/unique-email-addresses/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F929-Unique-Email-Addresses.java)
| [✔️](javascript%2F929-Unique-Email-Addresses.js)
| ❌
| [✔️](python%2F929-Unique-Email-Addresses.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F929-Unique-Email-Addresses.swift)
| [✔️](typescript%2F929-Unique-Email-Addresses.ts)
+[205 - Isomorphic Strings](https://leetcode.com/problems/isomorphic-strings/) | [✔️](c%2F205-Isomorphic-Strings.c)
| ❌
| ❌
| ❌
| [✔️](java%2F205-Isomorphic-Strings.java)
| [✔️](javascript%2F205-Isomorphic-Strings.js)
| ❌
| [✔️](python%2F205-Isomorphic-Strings.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F205-Isomorphic-Strings.swift)
| [✔️](typescript%2F205-Isomorphic-Strings.ts)
+[605 - Can Place Flowers](https://leetcode.com/problems/can-place-flowers/) | [✔️](c%2F605-Can-Place-Flowers.c)
| [✔️](cpp%2F605-Can-Place-Flowers.cpp)
| ❌
| ❌
| ❌
| [✔️](javascript%2F605-can-place-flowers.js)
| ❌
| [✔️](python%2F605-Can-Place-Flowers.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F605-Can-Place-Flowers.ts)
+[169 - Majority Element](https://leetcode.com/problems/majority-element/) | [✔️](c%2F169-Majority-Element.c)
| [✔️](cpp%2F169-Majority-Element.cpp)
| ❌
| ❌
| ❌
| [✔️](javascript%2F169-majority-element.js)
| ❌
| [✔️](python%2F169-Majority-Element.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F169-Majority-Element.swift)
| [✔️](typescript%2F169-Majority-Element.ts)
+[496 - Next Greater Element I](https://leetcode.com/problems/next-greater-element-i/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F496-Next-Greater-Element-I.java)
| ❌
| ❌
| [✔️](python%2F496-Next-Greater-Element-I.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F496-Next-Greater-Element-I.ts)
+[724 - Find Pivot Index](https://leetcode.com/problems/find-pivot-index/) | [✔️](c%2F724-Find-Pivot-Index.c)
| [✔️](cpp%2F724-Find-Pivot-Index.cpp)
| ❌
| ❌
| [✔️](java%2F724-Find-Pivot-Index.java)
| [✔️](javascript%2F724-Find-Pivot-Index.js)
| ❌
| [✔️](python%2F724-Find-Pivot-Index.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[448 - Find All Numbers Disappeared In An Array](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/) | ❌
| [✔️](cpp%2F448-Find-All-Numbers-Disappeared-In-An-Array.cpp)
| ❌
| ❌
| [✔️](java%2F448-Find-All-Numbers-Disappeared-in-an-Array.java)
| [✔️](javascript%2F448-find-all-numbers-disappeared-in-an-array.js)
| ❌
| [✔️](python%2F448-Find-all-Numbers-Disappeared-in-an-Array.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1189 - Maximum Number of Balloons](https://leetcode.com/problems/maximum-number-of-balloons/) | [✔️](c%2F1189-Maximum-Number-of-Balloons.c)
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F1189-maximum-number-of-balloons.js)
| ❌
| [✔️](python%2F1189-Maximum-Number-of-Balloons.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[290 - Word Pattern](https://leetcode.com/problems/word-pattern/) | ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F290-word-pattern.js)
| ❌
| [✔️](python%2F290-Word-Pattern.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F290-Word-Pattern.ts)
+[347 - Top K Frequent Elements](https://leetcode.com/problems/top-k-frequent-elements/) | ❌
| [✔️](cpp%2F347-Top-K-Frequent-Elements.cpp)
| [✔️](csharp%2F347-Top-K-Frequent-Elements.cs)
| [✔️](go%2F347-Top-K-Frequent-Elements.go)
| [✔️](java%2F347-Top-K-Frequent-Elements.java)
| [✔️](javascript%2F347-Top-K-Frequent-Elements.js)
| [✔️](kotlin%2F347-Top-K-Frequent-Elements.kt)
| [✔️](python%2F347-Top-k-frequent-elements.py)
| [✔️](ruby%2F347-Top-k-frequent-elements.rb)
| [✔️](rust%2F347-Top-K-Frequent-Elements.rs)
| ❌
| [✔️](swift%2F347-Top-k-frequent-elements.swift)
| [✔️](typescript%2F347-Top-K-Frequent-Elements.ts)
+[238 - Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/) | [✔️](c%2F238-Product-of-Array-Except-Self.c)
| [✔️](cpp%2F238-Product-Of-Array-Except-Self.cpp)
| [✔️](csharp%2F238-Product-Of-Array-Except-Self.cs)
| [✔️](go%2F238-Product-Of-Array-Except-Self.go)
| [✔️](java%2F238-Product-of-Array-Except-Self.java)
| [✔️](javascript%2F238-Product-of-Array-Except-Self.js)
| [✔️](kotlin%2F238-Product-Of-Array-Except-Self.kt)
| [✔️](python%2F238-Product-of-array-except-self.py)
| [✔️](ruby%2F238-Product-of-array-except-self.rb)
| [✔️](rust%2F238-Product-Of-Array-Except-Self.rs)
| ❌
| [✔️](swift%2F238-Product-of-array-except-self.swift)
| [✔️](typescript%2F238-Product-of-Array-Except-Self.ts)
+[36 - Valid Sudoku](https://leetcode.com/problems/valid-sudoku/) | [✔️](c%2F36-Valid-Sudoku.c)
| [✔️](cpp%2F36-Valid-Sudoku.cpp)
| [✔️](csharp%2F36-Valid-Sudoku.cs)
| [✔️](go%2F36-Valid-Sudoku.go)
| [✔️](java%2F36-Valid-Sudoku.java)
| [✔️](javascript%2F36-Valid-Sudoku.js)
| [✔️](kotlin%2F36-Valid-Sudoku.kt)
| [✔️](python%2F36-Valid-Sudoku.py)
| [✔️](ruby%2F36-Valid-Sudoku.rb)
| [✔️](rust%2F36-Valid-Sudoku.rs)
| ❌
| ❌
| [✔️](typescript%2F36-Valid-Sudoku.ts)
+[271 - Encode And Decode Strings](https://leetcode.com/problems/encode-and-decode-strings/) | ❌
| [✔️](cpp%2F271-Encode-And-Decode-Strings.cpp)
| ❌
| [✔️](go%2F271-Encode-And-Decode-Strings.go)
| [✔️](java%2F271-Encode-and-Decode-Strings.java)
| [✔️](javascript%2F271-Encode-and-Decode-Strings.js)
| ❌
| [✔️](python%2F271-Encode-and-Decode-Strings.py)
| [✔️](ruby%2F271-Encode-and-Decode-Strings.rb)
| [✔️](rust%2F271-Encode-And-Decode-Strings.rs)
| ❌
| [✔️](swift%2F271-Encode-and-Decode-Strings.swift)
| ❌
+[128 - Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [✔️](c%2F1288-Remove-Covered-Intervals.c)
| [✔️](cpp%2F128-Longest-Consecutive-Sequence.cpp)
| [✔️](csharp%2F128-Longest-Consecutive-Sequence.cs)
| [✔️](go%2F128-Longest-Consecutive-Sequence.go)
| [✔️](java%2F128-Longest-Consecutive-Sequence.java)
| [✔️](javascript%2F128-Longest-consecutive-sequence.js)
| [✔️](kotlin%2F128-Longest-Consecutive-Sequence.kt)
| [✔️](python%2F128-Longest-consecutive-sequence.py)
| [✔️](ruby%2F128-Longest-consecutive-sequence.rb)
| [✔️](rust%2F128-Longest-Consecutive-Sequence.rs)
| ❌
| [✔️](swift%2F128-Longest-Consecutive-Sequence.swift)
| [✔️](typescript%2F128-Longest-Consecutive-Sequence.ts)
+[75 - Sort Colors](https://leetcode.com/problems/sort-colors/) | [✔️](c%2F75-Sort-Colors.c)
| ❌
| [✔️](csharp%2F752-Open-the-Lock.cs)
| [✔️](go%2F75-Sort-Colors.go)
| [✔️](java%2F75-Sort-Colors.java)
| [✔️](javascript%2F75-sort-colors.js)
| [✔️](kotlin%2F75-Sort-Colors.kt)
| [✔️](python%2F752-Open-the-Lock.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[535 - Encode And Decode Tinyurl](https://leetcode.com/problems/encode-and-decode-tinyurl/) | ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F535-encode-and-decode-tinyurl.js)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[554 - Brick Wall](https://leetcode.com/problems/brick-wall/) | ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F554-brick-wall.js)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F554-Brick-Wall.ts)
+[122 - Best Time to Buy And Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [✔️](c%2F122-Best-Time-to-Buy-and-Sell-Stock-II.c)
| ❌
| ❌
| [✔️](go%2F122-Best-Time-to-Buy-and-Sell-Stock-II.go)
| ❌
| [✔️](javascript%2F122-best-time-to-buy-and-sell-stock-ii.js)
| ❌
| [✔️](python%2F1220-Count-Vowels-Permutation.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[560 - Subarray Sum Equals K](https://leetcode.com/problems/subarray-sum-equals-k/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F560-Subarray-Sum-Equals-K.java)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1930 - Unique Length 3 Palindromic Subsequences](https://leetcode.com/problems/unique-length-3-palindromic-subsequences/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1963 - Minimum Number of Swaps to Make The String Balanced](https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/) | ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F1963-minimum-number-of-swaps-to-make-the-string-balanced.js)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[2001 - Number of Pairs of Interchangeable Rectangles](https://leetcode.com/problems/number-of-pairs-of-interchangeable-rectangles/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[2002 - Maximum Product of The Length of Two Palindromic Subsequences](https://leetcode.com/problems/maximum-product-of-the-length-of-two-palindromic-subsequences/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[2017 - Grid Game](https://leetcode.com/problems/grid-game/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F2017-Grid-Game.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[438 - Find All Anagrams In a String](https://leetcode.com/problems/find-all-anagrams-in-a-string/) | ❌
| [✔️](cpp%2F438-Find-All-Anagrams-In-A-String.cpp)
| [✔️](csharp%2F438-Find-All-Anagrams-In-A-String.cs)
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F438-Find-All-Anagrams-In-A-String.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[28 - Find The Index of The First Occurrence In a String](https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/) | [✔️](c%2F283-Move-Zeroes.c)
| [✔️](cpp%2F283-Move-Zeroes.cpp)
| [✔️](csharp%2F286-Walls-and-Gates.cs)
| [✔️](go%2F287-Find-the-Duplicate-Number.go)
| [✔️](java%2F286-Walls-and-Gates.java)
| [✔️](javascript%2F283-Move-Zeroes.js)
| [✔️](kotlin%2F287-Find-The-Duplicate-Number.kt)
| [✔️](python%2F28-Implement-strStr.py)
| [✔️](ruby%2F287-Find-The-Duplicate-Number.rb)
| ❌
| ❌
| [✔️](swift%2F287-Find-The-Duplicate-Number.swift)
| [✔️](typescript%2F287-Find-the-Duplicate-Number.ts)
+[280 - Wiggle Sort](https://leetcode.com/problems/wiggle-sort/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[179 - Largest Number](https://leetcode.com/problems/largest-number/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F179-Largest-Number.ts)
+[523 - Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F523-Continuous-Subarray-Sum.java)
| ❌
| ❌
| [✔️](python%2F523-Continuous-Subarray-Sum.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[838 - Push Dominoes](https://leetcode.com/problems/push-dominoes/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[187 - Repeated Dna Sequences](https://leetcode.com/problems/repeated-dna-sequences/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F187-Repeated-DNA-Sequences.java)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[380 - Insert Delete Get Random O(1)](https://leetcode.com/problems/insert-delete-getrandom-o1/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1461 - Check if a String Contains All Binary Codes of Size K](https://leetcode.com/problems/check-if-a-string-contains-all-binary-codes-of-size-k/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[304 - Range Sum Query 2D Immutable](https://leetcode.com/problems/range-sum-query-2d-immutable/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[665 - Non Decreasing Array](https://leetcode.com/problems/non-decreasing-array/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[41 - First Missing Positive](https://leetcode.com/problems/first-missing-positive/) | [✔️](c%2F417-Pacific-Atlantic-Waterflow.c)
| [✔️](cpp%2F416-Partition-Equal-Subset-Sum.cpp)
| [✔️](csharp%2F416-Partition-Equal-Subset-Sum.cs)
| ❌
| [✔️](java%2F416-Partition-Equal-Subset-Sum.java)
| [✔️](javascript%2F416-Partition-Equal-Subset-Sum.js)
| [✔️](kotlin%2F417-Pacific-Atlantic-Waterflow.kt)
| [✔️](python%2F41-First-Missing-Positive.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F41-First-Missing-Positive.ts)
+
+### Two Pointers
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[125 - Valid Palindrome](https://leetcode.com/problems/valid-palindrome/) | [✔️](c%2F125-Valid-Palindrome.c)
| [✔️](cpp%2F125-Valid-Palindrome.cpp)
| [✔️](csharp%2F125-Valid-Palindrome.cs)
| [✔️](go%2F125-Valid-Palindrome.go)
| [✔️](java%2F125-Valid-Palindrome.java)
| [✔️](javascript%2F125-Valid-Palindrome.js)
| [✔️](kotlin%2F125-Valid-Palindrome.kt)
| [✔️](python%2F125-Valid-Palindrome.py)
| [✔️](ruby%2F125-Valid-Palindrome.rb)
| [✔️](rust%2F125-Valid-Palindrome.rs)
| ❌
| [✔️](swift%2F125-Valid-Palindrome.swift)
| [✔️](typescript%2F125-Valid-Palindrome.ts)
+[680 - Valid Palindrome II](https://leetcode.com/problems/valid-palindrome-ii/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F680-Valid-Palindrome-II.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1984 - Minimum Difference Between Highest And Lowest of K Scores](https://leetcode.com/problems/minimum-difference-between-highest-and-lowest-of-k-scores/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[344 - Reverse String](https://leetcode.com/problems/reverse-string/) | [✔️](c%2F344-Reverse-String.c)
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F344-Reverse-String.js)
| ❌
| [✔️](python%2F344-Reverse-String.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F344-Reverse-String.swift)
| [✔️](typescript%2F344-Reverse-String.ts)
+[88 - Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [✔️](c%2F88-Merge-Sorted-Array.c)
| ❌
| ❌
| ❌
| [✔️](java%2F88-Merge-Sorted-Array.java)
| ❌
| ❌
| [✔️](python%2F88.Merge-Sorted-Array.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[283 - Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [✔️](c%2F283-Move-Zeroes.c)
| [✔️](cpp%2F283-Move-Zeroes.cpp)
| ❌
| ❌
| ❌
| [✔️](javascript%2F283-Move-Zeroes.js)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[26 - Remove Duplicates From Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [✔️](c%2F263-Ugly-Number.c)
| [✔️](cpp%2F261-Graph-Valid-Tree.cpp)
| [✔️](csharp%2F261-Graph-Valid-Tree.cs)
| [✔️](go%2F26-Remove-Duplicates-From-Sorted-Array.go)
| [✔️](java%2F261-Graph-Valid-Tree.java)
| [✔️](javascript%2F261-Graph-Valid-Tree.js)
| [✔️](kotlin%2F268-Missing-Number.kt)
| [✔️](python%2F261-Graph-Valid-Tree.py)
| [✔️](ruby%2F268-Missing-Number.rb)
| [✔️](rust%2F268-Missing-Number.rs)
| ❌
| [✔️](swift%2F261-Graph-Valid-Tree.swift)
| [✔️](typescript%2F261-Graph-Valid-Tree.ts)
+[167 - Two Sum II Input Array Is Sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/) | [✔️](c%2F167-Two-Sum-II.c)
| [✔️](cpp%2F167-Two-Sum-II.cpp)
| [✔️](csharp%2F167-Two-Sum-II.cs)
| [✔️](go%2F167-Two-Sum-II.go)
| [✔️](java%2F167-Two-Sum-II.java)
| [✔️](javascript%2F167-Two-Sum-II.js)
| [✔️](kotlin%2F167-Two-Sum-2.kt)
| [✔️](python%2F167-Two-Sum-II.py)
| [✔️](ruby%2F167-Two-Sum-II.rb)
| [✔️](rust%2F167-Two-Sum-II.rs)
| ❌
| [✔️](swift%2F167-Two-Sum-II-Input-Array-Is-Sorted.swift)
| [✔️](typescript%2F167-Two-Sum-II.ts)
+[15 - 3Sum](https://leetcode.com/problems/3sum/) | [✔️](c%2F150-Evaluate-Reverse-Polish-Notation.c)
| [✔️](cpp%2F15-3sum.cpp)
| [✔️](csharp%2F15-3Sum.cs)
| [✔️](go%2F15-3Sum.go)
| [✔️](java%2F15-3Sum.java)
| [✔️](javascript%2F15-3Sum.js)
| [✔️](kotlin%2F15-3Sum.kt)
| [✔️](python%2F15-3Sum.py)
| [✔️](ruby%2F15-3Sum.rb)
| [✔️](rust%2F15-3sum.rs)
| [✔️](scala%2F15-3Sum.scala)
| [✔️](swift%2F15-3Sum.swift)
| [✔️](typescript%2F15-3Sum.ts)
+[18 - 4Sum](https://leetcode.com/problems/4sum/) | ❌
| [✔️](cpp%2F1851-Minimum-Interval-To-Include-Each-Query.cpp)
| [✔️](csharp%2F1838-Frequency-Of-The-Most-Frequent-Element.cs)
| ❌
| [✔️](java%2F1851-Minimum-Interval-to-Include-Each-Query.java)
| [✔️](javascript%2F1899-Merge-Triplets-to-Form-Target-Triplet.js)
| ❌
| [✔️](python%2F18-4Sum.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F1899-Merge-Triplets-To-Form-Target-Triplet.swift)
| [✔️](typescript%2F1899-Merge-Triplets-to-Form-Target-Triplet.ts)
+[11 - Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [✔️](c%2F11-Container-With-Most-Water.c)
| [✔️](cpp%2F11-Container-With-Most-Water.cpp)
| [✔️](csharp%2F11-Container-With-Most-Water.cs)
| [✔️](go%2F11-Container-with-Most-Water.go)
| [✔️](java%2F11-Container-With-Most-Water.java)
| [✔️](javascript%2F11-Container-With-Most-Water.js)
| [✔️](kotlin%2F11-Container-With-Most-Water.kt)
| [✔️](python%2F11-Container-With-Most-Water.py)
| [✔️](ruby%2F11-Container-With-Most-Water.rb)
| [✔️](rust%2F11-Container-With-Most-Water.rs)
| ❌
| [✔️](swift%2F11-Container-With-Most-Water.swift)
| [✔️](typescript%2F11-Container-With-Most-Water.ts)
+[1498 - Number of Subsequences That Satisfy The Given Sum Condition](https://leetcode.com/problems/number-of-subsequences-that-satisfy-the-given-sum-condition/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[189 - Rotate Array](https://leetcode.com/problems/rotate-array/) | ❌
| [✔️](cpp%2F189-Rotate-Array.cpp)
| [✔️](csharp%2F1899-Merge-Triplets-to-Form-Target-Triplet.cs)
| ❌
| [✔️](java%2F1899-Merge-Triplets-To-Form-Target-Triplet.java)
| [✔️](javascript%2F1899-Merge-Triplets-to-Form-Target-Triplet.js)
| ❌
| [✔️](python%2F1899-Merge-Triplets-to-Form-Target-Triplet.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F1899-Merge-Triplets-To-Form-Target-Triplet.swift)
| [✔️](typescript%2F1899-Merge-Triplets-to-Form-Target-Triplet.ts)
+[1968 - Array With Elements Not Equal to Average of Neighbors](https://leetcode.com/problems/array-with-elements-not-equal-to-average-of-neighbors/) | [✔️](c%2F1968-Array-Not-Average-Neighbors.c)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[881 - Boats to Save People](https://leetcode.com/problems/boats-to-save-people/) | [✔️](c%2F881-Boats-To-Save-People.c)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[42 - Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/) | [✔️](c%2F42-Trapping-Rain-Water.c)
| [✔️](cpp%2F42-Trapping-Rain-Water.cpp)
| [✔️](csharp%2F42-Trapping-Rain-Water.cs)
| [✔️](go%2F42-Trapping-Rain-Water.go)
| [✔️](java%2F42-Trapping-Rain-Water.java)
| [✔️](javascript%2F42-Trapping-Rain-Water.js)
| [✔️](kotlin%2F42-Trapping-Rain-Water.kt)
| [✔️](python%2F42-Trapping-Rain-Water.py)
| [✔️](ruby%2F42-Trapping-Rain-Water.rb)
| [✔️](rust%2F424-Longest-Repeating-Character-Replacement.rs)
| ❌
| [✔️](swift%2F42-Trapping-Rain-Water.swift)
| [✔️](typescript%2F42-Trapping-Rain-Water.ts)
+
+### Sliding Window
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[121 - Best Time to Buy And Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [✔️](c%2F121-Best-Time-To-Buy-And-Sell-Stock.c)
| [✔️](cpp%2F121-Best-Time-To-Buy-And-Sell-Stock.cpp)
| [✔️](csharp%2F121-Best-Time-To-Buy-and-Sell-Stock.cs)
| [✔️](go%2F121-Best-Time-To-Buy-And-Sell-Stock.go)
| [✔️](java%2F121-Best-Time-to-Buy-and-Sell-Stock.java)
| [✔️](javascript%2F121-Best-Time-to-Buy-and-Sell-Stock.js)
| [✔️](kotlin%2F121-Best-Time-to-Buy-and-Sell-Stocks.kt)
| [✔️](python%2F121-Best-Time-To-Buy-and-Sell-Stock.py)
| [✔️](ruby%2F121-Best-Time-To-Buy-and-Sell-Stock.rb)
| [✔️](rust%2F121-Best-Time-To-Buy.rs)
| ❌
| [✔️](swift%2F121-Best-Time-To-Buy-And-Sell-Stock.swift)
| [✔️](typescript%2F121-Best-Time-To-Buy-and-Sell-Stock.ts)
+[3 - Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [✔️](c%2F3-Longest-Substring-Without-Repeating-Characters.c)
| [✔️](cpp%2F3-Longest-Substring-Without-Repeating-Characters.cpp)
| [✔️](csharp%2F3-Longest-Substring-Without-Repeating-Characters.cs)
| [✔️](go%2F3-Longest-Substring-Without-Repeating-Characters.go)
| [✔️](java%2F3-Longest-Substring-Without-Repeating-Characters.java)
| [✔️](javascript%2F3-Longest-Substring-Without-Repeating-Characters.js)
| [✔️](kotlin%2F3-Longest-Substring-Without-Repeating-Characters.kt)
| [✔️](python%2F3-Longest-Substring-Without-Repeating-Characters.py)
| [✔️](ruby%2F3-Longest-Substring-Without-Repeating-Characters.rb)
| [✔️](rust%2F3-Longest-Substring-Without-Repeating-Characters.rs)
| [✔️](scala%2F3-Longest-Substring-Without-Repeating-Characters.scala)
| [✔️](swift%2F3-Longest-Substring-Without-Repeating-Characters.swift)
| [✔️](typescript%2F3-Longest-Substring-Without-Repeating-Characters.ts)
+[424 - Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [✔️](c%2F424-Longest-Repeating-Character-Replacement.c)
| [✔️](cpp%2F424-Longest-Repeating-Character-Replacement.cpp)
| [✔️](csharp%2F424-Longest-Repeating-Character-Replacement.cs)
| [✔️](go%2F424-Longest-Repeating-Character-Replacement.go)
| [✔️](java%2F424-Longest-Repeating-Character-Replacement.java)
| [✔️](javascript%2F424-Longest-Repeating-Character-Replacement.js)
| [✔️](kotlin%2F424-Longest-Repeating-Character-Replacement.kt)
| [✔️](python%2F424-Longest-Repeating-Character-Replacement.py)
| [✔️](ruby%2F424-Longest-Repeating-Character-Replacement.rb)
| [✔️](rust%2F424-Longest-Repeating-Character-Replacement.rs)
| ❌
| ❌
| [✔️](typescript%2F424-Longest-Repeating-Character-Replacement.ts)
+[567 - Permutation In String](https://leetcode.com/problems/permutation-in-string/) | [✔️](c%2F567-Permutation-in-String.c)
| [✔️](cpp%2F567-Permutation-In-String.cpp)
| [✔️](csharp%2F567-Permutation-In-String.cs)
| [✔️](go%2F567-Permutation-In-String.go)
| [✔️](java%2F567-Permutation-in-String.java)
| [✔️](javascript%2F567-Permutation-In-String.js)
| [✔️](kotlin%2F567-Permutation-In-String.kt)
| [✔️](python%2F567-Permutation-in-String.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F567-Permutation-in-String.ts)
+[1838 - Frequency of The Most Frequent Element](https://leetcode.com/problems/frequency-of-the-most-frequent-element/) | ❌
| ❌
| [✔️](csharp%2F1838-Frequency-Of-The-Most-Frequent-Element.cs)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1888 - Minimum Number of Flips to Make The Binary String Alternating](https://leetcode.com/problems/minimum-number-of-flips-to-make-the-binary-string-alternating/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[209 - Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [✔️](c%2F209-Minimum-Size-Subarray-Sum.c)
| [✔️](cpp%2F209-Minimum-Size-Subarray-Sum.cpp)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[658 - Find K Closest Elements](https://leetcode.com/problems/find-k-closest-elements/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F658-Find-K-Closest-Elements.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[76 - Minimum Window Substring](https://leetcode.com/problems/minimum-window-substring/) | [✔️](c%2F76-Minimum-Window-Substring.c)
| [✔️](cpp%2F76-Minimum-Window-Substring.cpp)
| [✔️](csharp%2F76-Minimum-Window-Substring.cs)
| [✔️](go%2F76-Minimum-Window-Substring.go)
| [✔️](java%2F76-Minimum-Window-Substring.java)
| [✔️](javascript%2F76-Minimum-Window-Substring.js)
| [✔️](kotlin%2F76-Minimum-Window-Substring.kt)
| [✔️](python%2F76-Minimum-Window-Substring.py)
| ❌
| [✔️](rust%2F76-Minimum-Window-Substring.rs)
| ❌
| ❌
| [✔️](typescript%2F76-Minimum-Window-Substring.ts)
+[239 - Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/) | ❌
| [✔️](cpp%2F239-Sliding-Window-Maximum.cpp)
| [✔️](csharp%2F239-Sliding-Window-Maximum.cs)
| [✔️](go%2F239-Sliding-Window-Maximum.go)
| [✔️](java%2F239-Sliding-Window-Maximum.java)
| [✔️](javascript%2F239-Sliding-Window-Maximum.js)
| [✔️](kotlin%2F239-Sliding-Window-Maximum.kt)
| [✔️](python%2F239-Sliding-Window-Maximum.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+
+### Stack
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[20 - Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | [✔️](c%2F20-Valid-Parentheses.c)
| [✔️](cpp%2F20-Valid-Parentheses.cpp)
| [✔️](csharp%2F20-Valid-Parentheses.cs)
| [✔️](go%2F20-Valid-Parentheses.go)
| [✔️](java%2F20-Valid-Parentheses.java)
| [✔️](javascript%2F20-Valid-Parentheses.js)
| [✔️](kotlin%2F20-Valid-Parentheses.kt)
| [✔️](python%2F20-Valid-Parentheses.py)
| [✔️](ruby%2F20-Valid-Parentheses.rb)
| [✔️](rust%2F20-Valid-Parentheses.rs)
| [✔️](scala%2F206-Reverse-Linked-List.scala)
| [✔️](swift%2F200-Number-of-Islands.swift)
| [✔️](typescript%2F20-Valid-Parentheses.ts)
+[682 - Baseball Game](https://leetcode.com/problems/baseball-game/) | [✔️](c%2F682-Baseball-Game.c)
| [✔️](cpp%2F682-Baseball-Game.cpp)
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F682-Baseball-Game.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[225 - Implement Stack Using Queues](https://leetcode.com/problems/implement-stack-using-queues/) | ❌
| [✔️](cpp%2F225-Implement-Stack-Using-Queues.cpp)
| ❌
| [✔️](go%2F225-Implement-Stack-using-Queues.go)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[155 - Min Stack](https://leetcode.com/problems/min-stack/) | ❌
| [✔️](cpp%2F155-Min-Stack.cpp)
| [✔️](csharp%2F155-Min-Stack.cs)
| [✔️](go%2F155-Min-Stack.go)
| [✔️](java%2F155-Min-Stack.java)
| [✔️](javascript%2F155-Min-Stack.js)
| [✔️](kotlin%2F155-Min-Stack.kt)
| [✔️](python%2F155-Min-Stack.py)
| [✔️](ruby%2F155-Min-Stack.rb)
| ❌
| ❌
| ❌
| [✔️](typescript%2F155-Min-Stack.ts)
+[150 - Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/) | [✔️](c%2F150-Evaluate-Reverse-Polish-Notation.c)
| [✔️](cpp%2F150-Evaluate-Reverse-Polish-Notation.cpp)
| [✔️](csharp%2F150-Evaluate-Reverse-Polish-Notation.cs)
| [✔️](go%2F150-Evaluate-Reverse-Polish-Notation.go)
| [✔️](java%2F150-Evaluate-Reverse-Polish-Notation.java)
| [✔️](javascript%2F150-Evaluate-Reverse-Polish-Notation.js)
| [✔️](kotlin%2F150-Evaluate-Reverse-Polish-Notation.kt)
| [✔️](python%2F150-Evaluate-Reverse-Polish-Notation.py)
| [✔️](ruby%2F150-Evaluate-Reverse-Polish-Notation.rb)
| ❌
| ❌
| [✔️](swift%2F150-Evaluate-Reverse-Polish-Notation.swift)
| [✔️](typescript%2F150-Evaluate-Reverse-Polish-Notation.ts)
+[22 - Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [✔️](c%2F226-Invert-Binary-Tree.c)
| [✔️](cpp%2F22-Generate-Parentheses.cpp)
| [✔️](csharp%2F22-Generate-Parentheses.cs)
| [✔️](go%2F22-Generate_Parentheses.go)
| [✔️](java%2F22-Generate-Parentheses.java)
| [✔️](javascript%2F22-Generate-Parentheses.js)
| [✔️](kotlin%2F22-Generate-Parentheses.kt)
| [✔️](python%2F22-Generate-Parentheses.py)
| [✔️](ruby%2F22-Generate-Parentheses.rb)
| ❌
| ❌
| ❌
| [✔️](typescript%2F22-Generate-Parentheses.ts)
+[735 - Asteroid Collision](https://leetcode.com/problems/asteroid-collision/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[739 - Daily Temperatures](https://leetcode.com/problems/daily-temperatures/) | [✔️](c%2F739-Daily-Temperatures.c)
| [✔️](cpp%2F739-Daily-Temperatures.cpp)
| [✔️](csharp%2F739-Daily-Temperatures.cs)
| [✔️](go%2F739-Daily-Temperatures.go)
| [✔️](java%2F739-Daily-Temperatures.java)
| [✔️](javascript%2F739-daily-temperatures.js)
| [✔️](kotlin%2F739-Daily-Temperatures.kt)
| [✔️](python%2F739-Daily-Temperatures.py)
| [✔️](ruby%2F739-Daily-Temperatures.rb)
| ❌
| ❌
| [✔️](swift%2F739-Daily-Temperatures.swift)
| [✔️](typescript%2F739-Daily-Temperatures.ts)
+[901 - Online Stock Span](https://leetcode.com/problems/online-stock-span/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F901-Online-Stock-Span.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[853 - Car Fleet](https://leetcode.com/problems/car-fleet/) | ❌
| [✔️](cpp%2F853-Car-Fleet.cpp)
| [✔️](csharp%2F853-Car-Fleet.cs)
| [✔️](go%2F853-Car-Fleet.go)
| ❌
| [✔️](javascript%2F853-Car-Fleet.js)
| [✔️](kotlin%2F853-Car-Fleet.kt)
| [✔️](python%2F853-Car-Fleet.py)
| [✔️](ruby%2F853-Car-Fleet.rb)
| ❌
| ❌
| ❌
| [✔️](typescript%2F853-Car-Fleet.ts)
+[71 - Simplify Path](https://leetcode.com/problems/simplify-path/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F713-Subarray-Product-Less-Than-K.java)
| ❌
| ❌
| [✔️](python%2F71-Simplify-Path.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F71-Simplify-Path.ts)
+[394 - Decode String](https://leetcode.com/problems/decode-string/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F394-decode-string.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[402 - Remove K Digits](https://leetcode.com/problems/remove-k-digits/) | ❌
| [✔️](cpp%2F402-Remove-K-Digits.cpp)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1209 - Remove All Adjacent Duplicates In String II](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/) | ❌
| [✔️](cpp%2F1209-Remove-All-Adjacent-Duplicates-in-String-II.cpp)
| ❌
| ❌
| ❌
| [✔️](javascript%2F1209-Remove-All-Adjacent-Duplicates-in-String-II.js)
| ❌
| [✔️](python%2F1209-Remove-All-Adjacent-Duplicates-in-String-II.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[132 - 132 Pattern](https://leetcode.com/problems/132-pattern/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[895 - Maximum Frequency Stack](https://leetcode.com/problems/maximum-frequency-stack/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[84 - Largest Rectangle In Histogram](https://leetcode.com/problems/largest-rectangle-in-histogram/) | [✔️](c%2F84.%20Largest%20Rectangle%20in%20Histogram)
| [✔️](cpp%2F84-Largest-Rectangle-In-Histogram.cpp)
| [✔️](csharp%2F84-Largest-Rectangle-in-Histogram.cs)
| [✔️](go%2F84-Largest-Rectangle-In-Histogram.go)
| [✔️](java%2F84-Largest-Rectangle-in-Histogram.java)
| [✔️](javascript%2F84-Largest-Rectangle-in-Histogram.js)
| [✔️](kotlin%2F84-Largest-Rectangle-In-Histogram.kt)
| [✔️](python%2F84-Largest-Rectangle-in-Histogram.py)
| ❌
| [✔️](rust%2F84-Largest-Rectangle-In-Histogram.rs)
| ❌
| ❌
| [✔️](typescript%2F84-Largest-Rectangle-in-Histogram.ts)
+
+### Binary Search
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[704 - Binary Search](https://leetcode.com/problems/binary-search/) | [✔️](c%2F704-Binary-Search.c)
| [✔️](cpp%2F704-Binary-Search.cpp)
| [✔️](csharp%2F704-Binary-Search.cs)
| [✔️](go%2F704-Binary-Search.go)
| [✔️](java%2F704-Binary-Search.java)
| [✔️](javascript%2F704-Binary-Search.js)
| [✔️](kotlin%2F704-Binary-Search.kt)
| [✔️](python%2F704-Binary-Search.py)
| [✔️](ruby%2F704-Binary-Search.rb)
| ❌
| ❌
| ❌
| [✔️](typescript%2F704-Binary-Search.ts)
+[35 - Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [✔️](c%2F35-Search-Insert-Position.c)
| [✔️](cpp%2F35-Search-Insert-Position.cpp)
| [✔️](csharp%2F355-Design-Twitter.cs)
| ❌
| [✔️](java%2F355-Design-Twitter.java)
| [✔️](javascript%2F35-Search-Insert-Position.js)
| ❌
| [✔️](python%2F35-Search-Insert-Position.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F35-Valid-Sudoku.swift)
| ❌
+[374 - Guess Number Higher Or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [✔️](c%2F374-Guess-Number-Higher-Or-Lower.c)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F374-Guess-Number-Higher-Or-Lower.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[441 - Arranging Coins](https://leetcode.com/problems/arranging-coins/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F441-Arranging-Coin.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[977 - Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array/) | ❌
| [✔️](cpp%2F977-Squares-of-a-Sorted-Array.cpp)
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F977-Squares-Of-A-Sorted-Array.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[367 - Valid Perfect Square](https://leetcode.com/problems/valid-perfect-square/) | ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F367-Valid-Perfect-Square.js)
| ❌
| [✔️](python%2F367-Valid-Perfect-Square.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[74 - Search a 2D Matrix](https://leetcode.com/problems/search-a-2d-matrix/) | [✔️](c%2F74-Search-A-2D-Matrix.c)
| [✔️](cpp%2F74-Search-A-2d-Matrix.cpp)
| [✔️](csharp%2F74-Search-A-2D-Matrix.cs)
| [✔️](go%2F74-Search-A-2D-Matrix.go)
| [✔️](java%2F74-Search-A-2D-Matrix.java)
| [✔️](javascript%2F74-Search-A-2D-Matrix.js)
| [✔️](kotlin%2F74-Search-A-2D-Matrix.kt)
| [✔️](python%2F74-Search-a-2D-Matrix.py)
| [✔️](ruby%2F74-Search-a-2D-Matrix.rb)
| [✔️](rust%2F746-Min-Cost-Climbing-Stairs.rs)
| ❌
| [✔️](swift%2F74-Search-A-2D-Matrix.swift)
| [✔️](typescript%2F74-Search-a-2D-Matrix.ts)
+[875 - Koko Eating Bananas](https://leetcode.com/problems/koko-eating-bananas/) | [✔️](c%2F875-Koko-Eating-Bananas.c)
| [✔️](cpp%2F875-Koko-Eating-Bananas.cpp)
| [✔️](csharp%2F875-Koko-Eating-Bananas.cs)
| [✔️](go%2F875-Koko-Eating-Bananas.go)
| [✔️](java%2F875-Koko-Eating-Bananas.java)
| [✔️](javascript%2F875-Koko-Eating-Bananas.js)
| [✔️](kotlin%2F875-Koko-Eating-Bananas.kt)
| [✔️](python%2F875-Koko-Eating-Bananas.py)
| [✔️](ruby%2F875-Koko-Eating-Bananas.rb)
| ❌
| ❌
| [✔️](swift%2F875-Koko-Eating-Bananas.swift)
| [✔️](typescript%2F875-Koko-Eating-Bananas.ts)
+[33 - Search In Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [✔️](c%2F33-Search-in-Rotated-Sorted-Array.c)
| [✔️](cpp%2F33-Search-In-Rotated-Sorted-Array.cpp)
| [✔️](csharp%2F33-Search-In-Rotated-Sorted-Array.cs)
| [✔️](go%2F33-Search-in-Rotated-Sorted-Array.go)
| [✔️](java%2F33-Search-In-Rotated-Sorted-Array.java)
| [✔️](javascript%2F33-Search-in-Rotated-Sorted-Array.js)
| [✔️](kotlin%2F33-Search-In-Rotated-Sorted-Array.kt)
| [✔️](python%2F33-Search-In-Rotated-Sorted-Array.py)
| [✔️](ruby%2F338-Counting-Bits.rb)
| [✔️](rust%2F33-Search-In-Rotated-Sorted-Array.rs)
| [✔️](scala%2F33-Search-in-Rotated-Sorted-Array.scala)
| [✔️](swift%2F33-Search-in-Rotated-Sorted-Array.swift)
| [✔️](typescript%2F33-Search-in-Rotated-Sorted-Array.ts)
+[153 - Find Minimum In Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [✔️](c%2F153-Find-Minimum-in-Rotated-Sorted-Array.c)
| [✔️](cpp%2F153-Find-Minimum-In-Rotated-Sorted-Array.cpp)
| [✔️](csharp%2F153-Find-Minimum-in-Rotated-Sorted-Array.cs)
| [✔️](go%2F153-Find-Minimum-in-Rotated-Sorted-Array.go)
| [✔️](java%2F153-Find-Minimum-in-Rotated-Sorted-Array.java)
| [✔️](javascript%2F153-Find-Minimum-in-Rotated-Sorted-Array.js)
| [✔️](kotlin%2F153-Find-Minimum-In-Rotated-Sorted-Array.kt)
| [✔️](python%2F153-Find-Minimum-in-Rotated-Sorted-Array.py)
| ❌
| [✔️](rust%2F153-Find-Minimum-In-Rotated-Sorted-Array.rs)
| [✔️](scala%2F153-Find-Minimum-In-Rotated-Sorted-Array.scala)
| [✔️](swift%2F153-Find-Minimum-in-Rotated-Sorted-Array.swift)
| [✔️](typescript%2F153-Find-Minimum-in-Rotated-Sorted-Array.ts)
+[981 - Time Based Key Value Store](https://leetcode.com/problems/time-based-key-value-store/) | ❌
| [✔️](cpp%2F981-Time-Based-Key-Value-Store.cpp)
| [✔️](csharp%2F981-Time-Based-Key-Value-Store.cs)
| [✔️](go%2F981-Time-Based-Key-Value-Store.go)
| [✔️](java%2F981-Time-Based-Key-Value-Store.java)
| [✔️](javascript%2F981-Time-Based-Key-Value-Store.js)
| [✔️](kotlin%2F981-Time-Based-Key-Value-Store.kt)
| [✔️](python%2F981-Time-Based-Key-Value-Store.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F981-Time-Based-Key-Value-Store.ts)
+[34 - Find First And Last Position of Element In Sorted Array](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/) | [✔️](c%2F344-Reverse-String.c)
| [✔️](cpp%2F342-Power-Of-Four.cpp)
| [✔️](csharp%2F34-Find-First-and-Last-Position-of-Element-in-Sorted-Array.cs)
| [✔️](go%2F347-Top-K-Frequent-Elements.go)
| [✔️](java%2F342-Power-of-Four.java)
| [✔️](javascript%2F344-Reverse-String.js)
| [✔️](kotlin%2F347-Top-K-Frequent-Elements.kt)
| [✔️](python%2F34-Find-First-and-Last-Position-of-Element-in-Sorted-Array.py)
| [✔️](ruby%2F347-Top-k-frequent-elements.rb)
| [✔️](rust%2F347-Top-K-Frequent-Elements.rs)
| ❌
| [✔️](swift%2F344-Reverse-String.swift)
| [✔️](typescript%2F344-Reverse-String.ts)
+[1898 - Maximum Number of Removable Characters](https://leetcode.com/problems/maximum-number-of-removable-characters/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[116 - Populating Next Right Pointers In Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F1160-Find-Words-That-Can-Be-Formed-by-Characters.java)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1268 - Search Suggestions System](https://leetcode.com/problems/search-suggestions-system/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[410 - Split Array Largest Sum](https://leetcode.com/problems/split-array-largest-sum/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F410-Split-Array-Largest-Sum.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[4 - Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [✔️](c%2F4-Median-of-Two-Sorted-Arrays.c)
| [✔️](cpp%2F4-Median-Of-Two-Sorted-Arrays.cpp)
| [✔️](csharp%2F4-Median-of-Two-Sorted-Arrays.cs)
| [✔️](go%2F4-Median-Of-Two-Sorted-Arrays.go)
| [✔️](java%2F4-Median-of-Two-Sorted-Arrays.java)
| [✔️](javascript%2F4-Median-Of-Two-Sorted-Arrays.js)
| [✔️](kotlin%2F4-Median-Of-Two-Sorted-Arrays.kt)
| [✔️](python%2F4-median-of-two-sorted-arrays.py)
| [✔️](ruby%2F42-Trapping-Rain-Water.rb)
| [✔️](rust%2F424-Longest-Repeating-Character-Replacement.rs)
| [✔️](scala%2F435-Non-Overlapping-Intervals.scala)
| [✔️](swift%2F42-Trapping-Rain-Water.swift)
| [✔️](typescript%2F4-Median-of-Two-Sorted-Arrays.ts)
+
+### Linked List
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[206 - Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [✔️](c%2F206-Reverse-Linked-List.c)
| [✔️](cpp%2F206-Reverse-Linked-List.cpp)
| [✔️](csharp%2F206-Reverse-Linked-List.cs)
| [✔️](go%2F206-Reverse-Linked-List.go)
| [✔️](java%2F206.%20Reverse%20Linked%20List.java)
| [✔️](javascript%2F206-Reverse-Linked-List.js)
| [✔️](kotlin%2F206-Reverse-Linked-List.kt)
| [✔️](python%2F206-Reverse-Linked-List.py)
| [✔️](ruby%2F206-Reverse-Linked-List.rb)
| ❌
| [✔️](scala%2F206-Reverse-Linked-List.scala)
| [✔️](swift%2F206-Reverse-Linked-List.swift)
| [✔️](typescript%2F206-Reverse-Linked-List.ts)
+[21 - Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/) | [✔️](c%2F21-Merge-Two-Sorted-Lists.c)
| [✔️](cpp%2F21-Merge-Two-Sorted-Lists.cpp)
| [✔️](csharp%2F21-Merge-Two-Sorted-Lists.cs)
| [✔️](go%2F21-Merge-Two-Sorted-Lists.go)
| [✔️](java%2F21-Merge-Two-Sorted-Lists.java)
| [✔️](javascript%2F21-Merge-Two-Sorted-Lists.js)
| [✔️](kotlin%2F21-Merge-Two-Sorted-Lists.kt)
| [✔️](python%2F21-Merge-Two-Sorted-Lists.py)
| [✔️](ruby%2F21-Merge-Two-Sorted-Lists.rb)
| [✔️](rust%2F211-Design-Add-And-Search-Words-Data-Structure.rs)
| [✔️](scala%2F21-Merge-Two-Sorted-Lists.scala)
| [✔️](swift%2F21-Merge-Two-Sorted-Lists.swift)
| [✔️](typescript%2F21-Merge-Two-Sorted-Lists.ts)
+[234 - Palindrome Linked List](https://leetcode.com/problems/palindrome-linked-list/) | ❌
| [✔️](cpp%2F234-Palindrome-Linked-List.cpp)
| ❌
| ❌
| [✔️](java%2F234.%20Palindrome%20Linked%20List.java)
| [✔️](javascript%2F234-Palindrome-Linked-List.js)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[203 - Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements/) | ❌
| ❌
| ❌
| [✔️](go%2F203-Remove-Linked-List-Element.go)
| ❌
| [✔️](javascript%2F203-Remove-Linked-List-Elements.js)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F203-Remove-Linked-List-Elements.ts)
+[83 - Remove Duplicates From Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/) | ❌
| [✔️](cpp%2F83-Remove-Duplicates-from-Sorted-List.cpp)
| ❌
| [✔️](go%2F83-Remove-Duplicates-from-Sorted-List.go)
| [✔️](java%2F83.%20Remove%20Duplicates%20from%20Sorted%20List.java)
| [✔️](javascript%2F83-Remove-Duplicates-From-Sorted-List.js)
| ❌
| [✔️](python%2F83-Remove-Duplicates-From-Sorted-List.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[160 - Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/) | ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F160-Intersection-of-Two-Linked-Lists.js)
| ❌
| [✔️](python%2F160-Intersection-of-Two-Linked-Lists.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[143 - Reorder List](https://leetcode.com/problems/reorder-list/) | [✔️](c%2F143-Reorder-List.c)
| [✔️](cpp%2F143-Reorder-List.cpp)
| [✔️](csharp%2F143-Reorder-List.cs)
| [✔️](go%2F143-Reorder-List.go)
| [✔️](java%2F143-Reorder-List.java)
| [✔️](javascript%2F143-Reorder-List.js)
| [✔️](kotlin%2F143-Reorder-List.kt)
| [✔️](python%2F143-Reorder-List.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F143-Reorder-List.ts)
+[19 - Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [✔️](c%2F19-Remove-Nth-Node-From-End-of-List.c)
| [✔️](cpp%2F19-Remove-Nth-Node-From-End-Of-List.cpp)
| [✔️](csharp%2F19-Remove-Nth-Node-From-End-of-List.cs)
| [✔️](go%2F19-Remove-Nth-Node-From-End-of-List.go)
| [✔️](java%2F19-Remove-Nth-Node-From-End-of-List.java)
| [✔️](javascript%2F19-Remove-Nth-Node-From-End-of-List.js)
| [✔️](kotlin%2F19-Remove-Nth-Node-From-End-of-List.kt)
| [✔️](python%2F19-Remove-Nth-node-from-end-of-List.py)
| [✔️](ruby%2F190-Reverse-Bits.rb)
| [✔️](rust%2F190-Reverse-Bits.rs)
| [✔️](scala%2F198-House-Robber.scala)
| [✔️](swift%2F19-Remove-Nth-Node-From-End-of-List.swift)
| [✔️](typescript%2F19-Remove-Nth-Node-From-End-of-List.ts)
+[138 - Copy List With Random Pointer](https://leetcode.com/problems/copy-list-with-random-pointer/) | [✔️](c%2F138-Copy-List-with-Random-Pointer.c)
| [✔️](cpp%2F138-Copy-List-With-Random-Pointer.cpp)
| [✔️](csharp%2F138-Copy-List-With-Random-Pointer.cs)
| ❌
| [✔️](java%2F138-Copy-List-with-Random-Pointer.java)
| [✔️](javascript%2F138-Copy-List-with-Random-Pointer.js)
| [✔️](kotlin%2F138-Copy-List-With-Random-Pointer.kt)
| [✔️](python%2F138-Copy-List-With-Random-Pointer.py)
| [✔️](ruby%2F138-Copy-List-With-Random-Pointer.rb)
| ❌
| ❌
| [✔️](swift%2F138-Copy-List-with-Random-Pointer.swift)
| [✔️](typescript%2F138-Copy-List-with-Random-Pointer.ts)
+[2 - Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [✔️](c%2F2-Add-Two-Numbers.c)
| [✔️](cpp%2F2-Add-Two-Numbers.cpp)
| [✔️](csharp%2F2-Add-Two-Numbers.cs)
| [✔️](go%2F20-Valid-Parentheses.go)
| [✔️](java%2F2-Add-Two-Numbers.java)
| [✔️](javascript%2F2-Add-Two-Numbers.js)
| [✔️](kotlin%2F2-Add-Two-Numbers.kt)
| [✔️](python%2F2-Add-Two-Numbers.py)
| [✔️](ruby%2F2-Add-Two-Numbers.rb)
| [✔️](rust%2F20-Valid-Parentheses.rs)
| [✔️](scala%2F2-Add-Two-Numbers.scala)
| [✔️](swift%2F2-Add-Two-Numbers.swift)
| [✔️](typescript%2F2-Add-Two-Numbers.ts)
+[141 - Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/) | [✔️](c%2F141-Linked-List-Cycle.c)
| [✔️](cpp%2F141-Linked-List-Cycle.cpp)
| [✔️](csharp%2F141-Linked-List-Cycle.cs)
| [✔️](go%2F141-Linked-List-Cycle.go)
| [✔️](java%2F141.%20Linked%20List%20Cycle.java)
| [✔️](javascript%2F141-Linked-List-Cycle.js)
| [✔️](kotlin%2F141-Linked-List-Cycle.kt)
| [✔️](python%2F141-Linked-List-Cycle.py)
| [✔️](ruby%2F141-Linked-List-Cycle.rb)
| ❌
| [✔️](scala%2F141-Linked-List-Cycle.scala)
| [✔️](swift%2F141-Linked-List-Cycle.swift)
| [✔️](typescript%2F141-Linked-List-Cycle.ts)
+[287 - Find The Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [✔️](c%2F287-Find-The-Duplicate-Number.c)
| [✔️](cpp%2F287-Find-The-Duplicate-Number.cpp)
| [✔️](csharp%2F287-Find-the-Duplicate-Number.cs)
| [✔️](go%2F287-Find-the-Duplicate-Number.go)
| [✔️](java%2F287-Find-the-Duplicate-Number.java)
| [✔️](javascript%2F287-Find-the-Duplicate-Number.js)
| [✔️](kotlin%2F287-Find-The-Duplicate-Number.kt)
| [✔️](python%2F287-Find-The-Duplicate-Number.py)
| [✔️](ruby%2F287-Find-The-Duplicate-Number.rb)
| ❌
| ❌
| [✔️](swift%2F287-Find-The-Duplicate-Number.swift)
| [✔️](typescript%2F287-Find-the-Duplicate-Number.ts)
+[24 - Swap Nodes In Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | [✔️](c%2F242-Valid-Anagram.c)
| [✔️](cpp%2F242-Valid-Anagram-Hashmap.cpp)
| [✔️](csharp%2F242-Valid-Anagram.cs)
| [✔️](go%2F24-Swap-Nodes-in-Pairs.go)
| [✔️](java%2F242-Valid-Anagram.java)
| [✔️](javascript%2F242-Valid-Anagram.js)
| [✔️](kotlin%2F242-Valid-Anagram.kt)
| [✔️](python%2F24-Swap-Nodes-in-Pairs.py)
| [✔️](ruby%2F242-Valid-Anagrams.rb)
| [✔️](rust%2F242-Valid-Anagram.rs)
| ❌
| [✔️](swift%2F242-Valid-Anagram.swift)
| [✔️](typescript%2F242-Valid-Anagram.ts)
+[148 - Sort List](https://leetcode.com/problems/sort-list/) | ❌
| ❌
| [✔️](csharp%2F1480-Running-Sum-Of-1D-Array.cs)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[86 - Partition List](https://leetcode.com/problems/partition-list/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F863-All-Nodes-Distance-K-in-Binary-Tree.java)
| ❌
| ❌
| [✔️](python%2F862-Shortest-Subarray-With-Sum-At-Least-K.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[61 - Rotate List](https://leetcode.com/problems/rotate-list/) | [✔️](c%2F617-Merge-Two-Binary-Trees.c)
| ❌
| ❌
| ❌
| [✔️](java%2F617-Merge-Two-Binary-Trees.java)
| [✔️](javascript%2F617-Merge-Two-Binary-Trees.js)
| ❌
| [✔️](python%2F617-Merge-Two-Binary-Trees.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[92 - Reverse Linked List II](https://leetcode.com/problems/reverse-linked-list-ii/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F929-Unique-Email-Addresses.java)
| [✔️](javascript%2F92-Reverse-Linked-List-II.js)
| ❌
| [✔️](python%2F92-Reverse-Linked-List-II.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F929-Unique-Email-Addresses.swift)
| [✔️](typescript%2F929-Unique-Email-Addresses.ts)
+[622 - Design Circular Queue](https://leetcode.com/problems/design-circular-queue/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[147 - Insertion Sort List](https://leetcode.com/problems/insertion-sort-list/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F1472-Design-Browser-History.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[146 - LRU Cache](https://leetcode.com/problems/lru-cache/) | [✔️](c%2F146-LRU-Cache.c)
| [✔️](cpp%2F146-Lru-Cache.cpp)
| [✔️](csharp%2F146-LRU-Cache.cs)
| ❌
| [✔️](java%2F146-LRU-Cache.java)
| [✔️](javascript%2F146-LRU-Cache.js)
| [✔️](kotlin%2F146-LRU-Cache.kt)
| [✔️](python%2F146-LRU-Cache.py)
| [✔️](ruby%2F146-LRU-Cache.rb)
| ❌
| ❌
| ❌
| ❌
+[23 - Merge K Sorted Lists](https://leetcode.com/problems/merge-k-sorted-lists/) | [✔️](c%2F23-Merge-K-Sorted-Lists.c)
| [✔️](cpp%2F23-Merge-K-Sorted-Lists.cpp)
| [✔️](csharp%2F23-Merge-K-Sorted-Lists.cs)
| [✔️](go%2F230-Kth-Smallest-Element-in-a-BST.go)
| [✔️](java%2F23-Merge-k-Sorted-Lists.java)
| [✔️](javascript%2F23-Merge-K-Sorted-Lists.js)
| [✔️](kotlin%2F23-Merge-K-Sorted-Lists.kt)
| [✔️](python%2F23-Merge-K-Sorted-Lists.py)
| [✔️](ruby%2F235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree.rb)
| [✔️](rust%2F238-Product-Of-Array-Except-Self.rs)
| [✔️](scala%2F235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree.scala)
| [✔️](swift%2F230-Kth-Smallest-Element-In-A-BST.swift)
| [✔️](typescript%2F23-Merge-k-Sorted-Lists.ts)
+[25 - Reverse Nodes In K Group](https://leetcode.com/problems/reverse-nodes-in-k-group/) | [✔️](c%2F25-Reverse-Nodes-in-k-Group.c)
| [✔️](cpp%2F25-Reverse-Nodes-In-K-Group.cpp)
| [✔️](csharp%2F25-Reverse-Nodes-in-k-Group.cs)
| ❌
| [✔️](java%2F25-Reverse-Nodes-in-k-Group.java)
| [✔️](javascript%2F25-Reverse-Nodes-in-K-Group.js)
| [✔️](kotlin%2F25-Reverse-Nodes-In-K-Group.kt)
| [✔️](python%2F25-Reverse-Nodes-in-K-Group.py)
| ❌
| [✔️](rust%2F253-Meeting-Rooms.rs)
| ❌
| ❌
| [✔️](typescript%2F25-Reverse-Nodes-in-k-Group.ts)
+
+### Trees
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[94 - Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [✔️](c%2F94-Binary-Tree-Inorder-Traversal.c)
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F94-Binary-Tree-Inorder-Traversal.js)
| ❌
| [✔️](python%2F94-Binary-Tree-Inorder-Traversal.py)
| [✔️](ruby%2F94-Binary-Tree-Inorder-Traversal.rb)
| ❌
| ❌
| ❌
| [✔️](typescript%2F94-Binary-Tree-Inorder-Traversal.ts)
+[226 - Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree/) | [✔️](c%2F226-Invert-Binary-Tree.c)
| [✔️](cpp%2F226-Invert-Binary-Tree.cpp)
| [✔️](csharp%2F226-Invert-Binary-Tree.cs)
| [✔️](go%2F226-Invert-Binary-Tree.go)
| [✔️](java%2F226-Invert-Binary-Tree.java)
| [✔️](javascript%2F226-Invert-Binary-Tree.js)
| [✔️](kotlin%2F226-Invert-Binary-Tree.kt)
| [✔️](python%2F226-Invert-Binary-Tree.py)
| [✔️](ruby%2F226-Invert-Binary-Tree.rb)
| ❌
| ❌
| ❌
| [✔️](typescript%2F226-Invert-Binary-Tree.ts)
+[104 - Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [✔️](c%2F104-Maximum-Depth-Of-Binary-Tree.c)
| [✔️](cpp%2F104-Maximum-Depth-Of-Binary-Tree.cpp)
| [✔️](csharp%2F104-Maximum-Depth-of-Binary-Tree.cs)
| [✔️](go%2F104-Maximum-Depth-of-Binary-Tree.go)
| [✔️](java%2F104-Maximum-Depth-of-Binary-Tree.java)
| [✔️](javascript%2F104-Maximum-Depth-of-Binary-Tree.js)
| [✔️](kotlin%2F104-Maximum-Depth-Of-Binary-Tree.kt)
| [✔️](python%2F104-Maximum-Depth-of-Binary-Tree.py)
| [✔️](ruby%2F104-Maximum-Depth-of-Binary-Tree.rb)
| ❌
| ❌
| [✔️](swift%2F104-Maximum-Depth-of-Binary-Tree.swift)
| [✔️](typescript%2F104-Maximum-Depth-of-Binary-Tree.ts)
+[543 - Diameter of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/) | [✔️](c%2F543-Diameter-Of-Binary-Tree.c)
| [✔️](cpp%2F543-Diameter-Of-Binary-Tree.cpp)
| [✔️](csharp%2F543-Diameter-of-Binary-Tree.cs)
| [✔️](go%2F543-Diameter-of-Binary-Tree.go)
| [✔️](java%2F543-Diameter-of-Binary-Tree.java)
| [✔️](javascript%2F543-Diameter-Of-Binary-Tree.js)
| [✔️](kotlin%2F543-Diameter-of-Binary-Tree.kt)
| [✔️](python%2F543-Diameter-of-Binary-Tree.py)
| [✔️](ruby%2F543-Diameter-of-Binary-Tree.rb)
| ❌
| ❌
| [✔️](swift%2F543-Diameter-of-Binary-Tree.swift)
| [✔️](typescript%2F543-Diameter-of-Binary-Tree.ts)
+[110 - Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree/) | [✔️](c%2F110-Balanced-Binary-Tree.c)
| [✔️](cpp%2F110-Balanced-Binary-Tree.cpp)
| [✔️](csharp%2F110-Balanced-Binary-Tree.cs)
| [✔️](go%2F110-Balanced-Binary-Tree.go)
| [✔️](java%2F110-Balanced-Binary-Tree.java)
| [✔️](javascript%2F110-Balanced-Binary-Tree.js)
| [✔️](kotlin%2F110-Balanced-Binary-Tree.kt)
| [✔️](python%2F110-Balanced-Binary-Tree.py)
| [✔️](ruby%2F110-Balanced-Binary-Tree.rb)
| ❌
| ❌
| [✔️](swift%2F110-Balanced-Binary-Tree.swift)
| [✔️](typescript%2F110-Balanced-Binary-Tree.ts)
+[100 - Same Tree](https://leetcode.com/problems/same-tree/) | [✔️](c%2F100-Same-Tree.c)
| [✔️](cpp%2F100-Same-Tree.cpp)
| [✔️](csharp%2F100-Same-Tree.cs)
| [✔️](go%2F100-Same-Tree.go)
| [✔️](java%2F100-Same-Tree.java)
| [✔️](javascript%2F100-Same-Tree.js)
| [✔️](kotlin%2F100-Same-Tree.kt)
| [✔️](python%2F100-Same-Tree.py)
| [✔️](ruby%2F100-Same-Tree.rb)
| ❌
| ❌
| [✔️](swift%2F100-Same-Tree.swift)
| [✔️](typescript%2F100-Same-Tree.ts)
+[572 - Subtree of Another Tree](https://leetcode.com/problems/subtree-of-another-tree/) | [✔️](c%2F572-Subtree-Of-Another-Tree.c)
| [✔️](cpp%2F572-Subtree-Of-Another-Tree.cpp)
| [✔️](csharp%2F572-Subtree-of-Another-Tree.cs)
| [✔️](go%2F572-Subtree-of-Another-Tree.go)
| [✔️](java%2F572-Subtree-of-Another-Tree.java)
| [✔️](javascript%2F572-Subtree-of-Another-Tree.js)
| [✔️](kotlin%2F572-Subtree-Of-Another-Tree.kt)
| [✔️](python%2F572-Subtree-of-Another-Tree.py)
| [✔️](ruby%2F572-Subtree-of-Another-Tree.rb)
| ❌
| [✔️](scala%2F572-Subtree-of-Another-Tree.scala)
| [✔️](swift%2F572-Subtree-of-Another-Tree.swift)
| [✔️](typescript%2F572-Subtree-of-Another-Tree.ts)
+[108 - Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [✔️](c%2F108-Convert-Sorted-Array.c)
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F108-Convert-Sorted-Array-to-Binary-Search-Tree.js)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[617 - Merge Two Binary Trees](https://leetcode.com/problems/merge-two-binary-trees/) | [✔️](c%2F617-Merge-Two-Binary-Trees.c)
| ❌
| ❌
| ❌
| [✔️](java%2F617-Merge-Two-Binary-Trees.java)
| [✔️](javascript%2F617-Merge-Two-Binary-Trees.js)
| ❌
| [✔️](python%2F617-Merge-Two-Binary-Trees.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[112 - Path Sum](https://leetcode.com/problems/path-sum/) | [✔️](c%2F112-Path-Sum.c)
| ❌
| [✔️](csharp%2F112-Path-Sum.cs)
| ❌
| ❌
| [✔️](javascript%2F112-Path-Sum.js)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[606 - Construct String From Binary Tree](https://leetcode.com/problems/construct-string-from-binary-tree/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[235 - Lowest Common Ancestor of a Binary Search Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/) | [✔️](c%2F235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.c)
| [✔️](cpp%2F235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.cpp)
| [✔️](csharp%2F235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree.cs)
| [✔️](go%2F235-Lowest-Common-Ancestor-Of-BST.go)
| [✔️](java%2F235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree.java)
| [✔️](javascript%2F235-lowest-common-ancestor-of-a-binary-search-tree.js)
| [✔️](kotlin%2F235-Lowest-Common-Ancestor-Of-Binary-Search-Tree.kt)
| [✔️](python%2F235-lowest-common-ancestor-of-a-binary-search-tree.py)
| [✔️](ruby%2F235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree.rb)
| ❌
| [✔️](scala%2F235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree.scala)
| [✔️](swift%2F235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree.swift)
| ❌
+[102 - Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [✔️](c%2F102-Binary-Tree-Level-Order-Traversal.c)
| [✔️](cpp%2F102-Binary-Tree-Level-Order-Traversal.cpp)
| [✔️](csharp%2F102-Binary-Tree-Level-Order-Traversal.cs)
| [✔️](go%2F102-Binary-Tree-Level-Order-Traversal.go)
| [✔️](java%2F102-Binary-Tree-Level-Order-Traversal.java)
| [✔️](javascript%2F102-Binary-Tree-Level-Order-Traversal.js)
| [✔️](kotlin%2F102-Binary-Tree-Level-Order-Traversal.kt)
| [✔️](python%2F102-Binary-Tree-Level-Order-Traversal.py)
| [✔️](ruby%2F102-Binary-Tree-Level-Order-Traversal.rb)
| ❌
| ❌
| [✔️](swift%2F102-Binary-Tree-Level-Order-Traversal.swift)
| [✔️](typescript%2F102-Binary-Tree-Level-Order-Traversal.ts)
+[199 - Binary Tree Right Side View](https://leetcode.com/problems/binary-tree-right-side-view/) | [✔️](c%2F199-Binary-Tree-Right-Side-View.c)
| [✔️](cpp%2F199-Binary-Tree-Right-Side-View.cpp)
| [✔️](csharp%2F199-Binary-Tree-Right-Side-View.cs)
| ❌
| [✔️](java%2F199-Binary-Tree-Right-Side-View.java)
| [✔️](javascript%2F199-binary-tree-right-side-view.js)
| [✔️](kotlin%2F199-Binary-Tree-Right-Side-View.kt)
| [✔️](python%2F199-Binary-Tree-Right-Side-View.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F199-Binary-Tree-Right-Side-View.swift)
| [✔️](typescript%2F199-Binary-Tree-Right-Side-View.ts)
+[1448 - Count Good Nodes In Binary Tree](https://leetcode.com/problems/count-good-nodes-in-binary-tree/) | [✔️](c%2F1448-Count-Good-Nodes-in-Binary-Tree.c)
| [✔️](cpp%2F1448-Count-Good-Nodes-In-Binary-Tree.cpp)
| [✔️](csharp%2F1448-Count-Good-Nodes-in-Binary-Tree.cs)
| [✔️](go%2F1448-Count-Good-Nodes-in-BT.go)
| [✔️](java%2F1448-Count-Good-Nodes-in-Binary-Tree.java)
| [✔️](javascript%2F1448-Count-Good-Nodes-in-Binary-Tree.js)
| [✔️](kotlin%2F1448-Count-Good-Nodes-In-Binary-Tree.kt)
| [✔️](python%2F1448-Count-Good-Nodes-in-Binary-Tree.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F1448-Count-Good-Nodes-In-Binary-Tree-2.swift)
| [✔️](typescript%2F1448-Count-Good-Nodes-in-Binary-Tree.ts)
+[98 - Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [✔️](c%2F98-Validate-Binary-Search-Tree.c)
| [✔️](cpp%2F98-Validate-Binary-Search-Tree.cpp)
| [✔️](csharp%2F98-Validate-Binary-Search-Tree.cs)
| [✔️](go%2F98-Validate-Binary-Search-Tree.go)
| [✔️](java%2F98-Validate-Binary-Search-Tree.java)
| [✔️](javascript%2F98-Validate-Binary-Search-Tree.js)
| [✔️](kotlin%2F98-Validate-Binary-Search-Tree.kt)
| [✔️](python%2F98-Validate-Binary-Search-Tree.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F98-Validate-Binary-Search-Tree.swift)
| [✔️](typescript%2F98-Validate-Binary-Search-Tree.ts)
+[230 - Kth Smallest Element In a Bst](https://leetcode.com/problems/kth-smallest-element-in-a-bst/) | [✔️](c%2F230-Kth-Smallest-Element-In-BST.c)
| [✔️](cpp%2F230-Kth-Smallest-Element-In-A-Bst.cpp)
| [✔️](csharp%2F230-Kth-Smallest-Element-in-a-BST.cs)
| [✔️](go%2F230-Kth-Smallest-Element-in-a-BST.go)
| [✔️](java%2F230-Kth-Smallest-Element-in-a-BST.java)
| [✔️](javascript%2F230-Kth-Smallest-Element-in-a-BST.js)
| [✔️](kotlin%2F230-Kth-Smallest-Element-In-A-BST.kt)
| [✔️](python%2F230-Kth-Smallest-Element-in-a-BST.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F230-Kth-Smallest-Element-In-A-BST.swift)
| [✔️](typescript%2F230-Kth-Smallest-Element-In-A-BST.ts)
+[105 - Construct Binary Tree From Preorder And Inorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/) | [✔️](c%2F105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.c)
| [✔️](cpp%2F105-Construct-Binary-Tree-From-Preorder-And-Inorder.cpp)
| [✔️](csharp%2F105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.cs)
| ❌
| [✔️](java%2F105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.java)
| [✔️](javascript%2F105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.js)
| [✔️](kotlin%2F105-Construct-Binary-Tree-From-Preorder-And-Inorder-Traversal.kt)
| [✔️](python%2F105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.ts)
+[96 - Unique Binary Search Trees](https://leetcode.com/problems/unique-binary-search-trees/) | [✔️](c%2F96-Unique-Binary-Search-Tree.c)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[129 - Sum Root to Leaf Numbers](https://leetcode.com/problems/sum-root-to-leaf-numbers/) | [✔️](c%2F129-Sum-Root-To-Leaf.c)
| [✔️](cpp%2F1299-Replace-Elements-with-Greatest-Element-on-Right-Side.cpp)
| [✔️](csharp%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.cs)
| [✔️](go%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.go)
| [✔️](java%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.java)
| [✔️](javascript%2F1299-Replace-Elements-with-Greatest-Element-on-Right-Side.js)
| ❌
| [✔️](python%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.py)
| ❌
| [✔️](rust%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.rs)
| ❌
| ❌
| [✔️](typescript%2F1299-Replace-Elements-With-Greatest-Element-On-Right-Side.ts)
+[337 - House Robber III](https://leetcode.com/problems/house-robber-iii/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[951 - Flip Equivalent Binary Trees](https://leetcode.com/problems/flip-equivalent-binary-trees/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1993 - Operations On Tree](https://leetcode.com/problems/operations-on-tree/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[894 - All Possible Full Binary Trees](https://leetcode.com/problems/all-possible-full-binary-trees/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[513 - Find Bottom Left Tree Value](https://leetcode.com/problems/find-bottom-left-tree-value/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F513-Find-Bottom-Left-Tree-Value.java)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[669 - Trim a Binary Search Tree](https://leetcode.com/problems/trim-a-binary-search-tree/) | ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F669-Trim-a-Binary-Search-Tree.js)
| ❌
| [✔️](python%2F669-Trim-a-Binary-Search-Tree.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F669-Trim-a-Binary-Search-Tree.ts)
+[173 - Binary Search Tree Iterator](https://leetcode.com/problems/binary-search-tree-iterator/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F173-Binary-Search-Tree-Iterator.java)
| [✔️](javascript%2F173-Binary-Search-Tree-Iterator.js)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[538 - Convert Bst to Greater Tree](https://leetcode.com/problems/convert-bst-to-greater-tree/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[124 - Binary Tree Maximum Path Sum](https://leetcode.com/problems/binary-tree-maximum-path-sum/) | [✔️](c%2F124-Binary-Tree-Maximum-Path-Sum.c)
| [✔️](cpp%2F124-Binary-Tree-Maximum-Path-Sum.cpp)
| [✔️](csharp%2F124-Binary-Tree-Maximum-Path-Sum.cs)
| [✔️](go%2F124-Binary-Tree-Maximum-Path-Sum.go)
| [✔️](java%2F124-Binary-Tree-Maximum-Path-Sum.java)
| [✔️](javascript%2F124-Binary-Tree-Maximum-Path-Sum.js)
| [✔️](kotlin%2F124-Binary-Tree-Maximumu-Path-Sum.kt)
| [✔️](python%2F124-Binary-Tree-Maximum-Path-Sum.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F124-Binary-Tree-Maximum-Path-Sum.swift)
| [✔️](typescript%2F124-Binary-Tree-Maximum-Path-Sum.ts)
+[297 - Serialize And Deserialize Binary Tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/) | [✔️](c%2F297-Serialize-and-Deserialize-Binary-Tree.c)
| [✔️](cpp%2F297-Serialize-And-Deserialize-Binary-Tree.cpp)
| [✔️](csharp%2F297-Serialize-and-Deserialize-Binary-Tree.cs)
| ❌
| [✔️](java%2F297-Serialize-and-Deserialize-Binary-Tree.java)
| [✔️](javascript%2F297-Serialize-And-Deserialize-Binary-Tree.js)
| [✔️](kotlin%2F297-Serialize-And-Deserialize-Binary-Tree.kt)
| [✔️](python%2F297-Serialize-and-Deserialize-Binary-Tree.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+
+### Tries
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[208 - Implement Trie Prefix Tree](https://leetcode.com/problems/implement-trie-prefix-tree/) | [✔️](c%2F208-Implement-Trie-Prefix-Tree.c)
| [✔️](cpp%2F208-Implement-Trie-Prefix-Tree.cpp)
| [✔️](csharp%2F208-Implement-Trie.cs)
| [✔️](go%2F208-Implement-Trie.go)
| [✔️](java%2F208-Implement-Trie-Prefix-Tree.java)
| [✔️](javascript%2F208-Implement-Trie.js)
| [✔️](kotlin%2F208-Implement-Trie.kt)
| [✔️](python%2F208-Implement-Trie.py)
| [✔️](ruby%2F208-Implement-Trie.rb)
| [✔️](rust%2F208-Implement-Trie.rs)
| ❌
| ❌
| [✔️](typescript%2F208-Implement-Trie.ts)
+[211 - Design Add And Search Words Data Structure](https://leetcode.com/problems/design-add-and-search-words-data-structure/) | ❌
| [✔️](cpp%2F211-Design-Add-And-Search-Words-Data-Structure.cpp)
| [✔️](csharp%2F211-Design-Add-and-Search-Words-Data-Structure.cs)
| ❌
| [✔️](java%2F211-Design-Add-and-Search-Words-Data-Structure.java)
| [✔️](javascript%2F211-Design-Add-and-Search-Words-Data-Structure.js)
| [✔️](kotlin%2F211-Design-Add-And-Search-Words-Data-Structure.kt)
| [✔️](python%2F211-Design-Add-and-Search-Words-Data-Structure.py)
| [✔️](ruby%2F211-Design-Add-and-Search-Words-Data-Structure.rb)
| [✔️](rust%2F211-Design-Add-And-Search-Words-Data-Structure.rs)
| ❌
| ❌
| [✔️](typescript%2F211-Design-Add-and-Search-Words-Data-Structure.ts)
+[212 - Word Search II](https://leetcode.com/problems/word-search-ii/) | ❌
| [✔️](cpp%2F212-Word-Search-II.cpp)
| [✔️](csharp%2F212-Word-Search-II.cs)
| ❌
| [✔️](java%2F212-Word-Search-II.java)
| [✔️](javascript%2F212-Word-Search-ii.js)
| [✔️](kotlin%2F212-Word-Search-II.kt)
| [✔️](python%2F212-Word-Search-II.py)
| ❌
| [✔️](rust%2F212-Word-Search-II.rs)
| ❌
| [✔️](swift%2F212-Word-Search-II.swift)
| ❌
+
+### Heap / Priority Queue
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[703 - Kth Largest Element In a Stream](https://leetcode.com/problems/kth-largest-element-in-a-stream/) | [✔️](c%2F703-Kth-Largest-Element-In-A-Stream.c)
| [✔️](cpp%2F703-Kth-Largest-Element-In-A-Stream.cpp)
| [✔️](csharp%2F703-Kth-Largest-Element-In-A-Stream.cs)
| ❌
| [✔️](java%2F703-Kth-Largest-Element-in-a-Stream.java)
| [✔️](javascript%2F703-Kth-Largest-Element-In-A-Stream.js)
| ❌
| [✔️](python%2F703-Kth-Largest-Element-in-a-Stream.py)
| [✔️](ruby%2F703-Kth-Largest-Element-in-a-Stream.rb)
| ❌
| ❌
| [✔️](swift%2F703-Kth-Largest-Element-In-A-Stream.swift)
| ❌
+[1046 - Last Stone Weight](https://leetcode.com/problems/last-stone-weight/) | ❌
| [✔️](cpp%2F1046-Last-Stone-Weight.cpp)
| [✔️](csharp%2F1046-Last-Stone-Weight.cs)
| ❌
| [✔️](java%2F1046-Last-Stone-Weight.java)
| [✔️](javascript%2F1046-Last-Stone-Weight.js)
| [✔️](kotlin%2F1046-Last-Stone-Weight.kt)
| [✔️](python%2F1046-Last-Stone-Weight.py)
| [✔️](ruby%2F1046-Last-Stone-Weight.rb)
| ❌
| ❌
| ❌
| [✔️](typescript%2F1046-Last-Stone-Weight.ts)
+[973 - K Closest Points to Origin](https://leetcode.com/problems/k-closest-points-to-origin/) | ❌
| [✔️](cpp%2F973-K-Closest-Points-To-Origin.cpp)
| [✔️](csharp%2F973-K-Closest-Points-To-Origin.cs)
| ❌
| [✔️](java%2F973-K-Closest-Points-to-Origin.java)
| [✔️](javascript%2F973-K-Closest-Points-to-Origin.js)
| [✔️](kotlin%2F973-K-Closest-Points-To-Origin.kt)
| [✔️](python%2F973-K-Closest-Points-to-Origin.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[215 - Kth Largest Element In An Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | ❌
| [✔️](cpp%2F215-Kth-Largest-Element-In-Array.cpp)
| [✔️](csharp%2F215-Kth-Largest-Element-in-an-Array.cs)
| ❌
| [✔️](java%2F215-Kth-Largest-Element-in-an-Array.java)
| [✔️](javascript%2F215-Kth-Largest-Element-in-an-Array.js)
| [✔️](kotlin%2F215-Kth-Largest-Element-In-Array.kt)
| [✔️](python%2F215-Kth-Largest-Element-in-an-Array.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F215-Kth-Largest-Element-in-an-Array.ts)
+[621 - Task Scheduler](https://leetcode.com/problems/task-scheduler/) | ❌
| [✔️](cpp%2F621-Task-Scheduler.cpp)
| [✔️](csharp%2F621-Task-Scheduler.cs)
| ❌
| [✔️](java%2F621-Task-Scheduler.java)
| [✔️](javascript%2F621-Task-Scheduler.js)
| ❌
| [✔️](python%2F621-Task-Scheduler.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F621-Task-Scheduler.ts)
+[355 - Design Twitter](https://leetcode.com/problems/design-twitter/) | ❌
| [✔️](cpp%2F355-Design-Twitter.cpp)
| [✔️](csharp%2F355-Design-Twitter.cs)
| ❌
| [✔️](java%2F355-Design-Twitter.java)
| [✔️](javascript%2F355-Design-Twitter.js)
| ❌
| [✔️](python%2F355-Design-Twitter.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1834 - Single Threaded Cpu](https://leetcode.com/problems/single-threaded-cpu/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1845 - Seat Reservation Manager](https://leetcode.com/problems/seat-reservation-manager/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F1845-Seat-Reservation-Manager.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1882 - Process Tasks Using Servers](https://leetcode.com/problems/process-tasks-using-servers/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1985 - Find The Kth Largest Integer In The Array](https://leetcode.com/problems/find-the-kth-largest-integer-in-the-array/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F1985-Find-The-Kth-Largest-Integer-In-The-Array.java)
| ❌
| ❌
| [✔️](python%2F1985-Find-The-Kth-Largest-Integer-In-The-Array.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F1985-Find-The-Kth-Largest-Integer-In-The-Array.swift)
| ❌
+[767 - Reorganize String](https://leetcode.com/problems/reorganize-string/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F767-Reorganize-String.java)
| ❌
| ❌
| [✔️](python%2F767-Reorganize-String.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1405 - Longest Happy String](https://leetcode.com/problems/longest-happy-string/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1094 - Car Pooling](https://leetcode.com/problems/car-pooling/) | ❌
| ❌
| [✔️](csharp%2F1094-Car-Pooling.cs)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[295 - Find Median From Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | ❌
| [✔️](cpp%2F295-Find-Median-From-Data-Stream.cpp)
| [✔️](csharp%2F295-Find-Median-From-Data-Stream.cs)
| ❌
| [✔️](java%2F295-Find-Median-from-Data-Stream.java)
| [✔️](javascript%2F295-Find-Median-from-Data-Stream.js)
| [✔️](kotlin%2F295-Find-Median-From-Data-Stream.kt)
| [✔️](python%2F295-Find-Median-from-Data-Stream.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1383 - Maximum Performance of a Team](https://leetcode.com/problems/maximum-performance-of-a-team/) | ❌
| ❌
| [✔️](csharp%2F1383-Maximum-Performance-Of-A-Team.cs)
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F1383-Maximum-Performance-Of-A-Team.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+
+### Backtracking
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[78 - Subsets](https://leetcode.com/problems/subsets/) | [✔️](c%2F78-Subsets.c)
| [✔️](cpp%2F78-Subsets.cpp)
| [✔️](csharp%2F78-Subsets.cs)
| [✔️](go%2F78-Subsets.go)
| [✔️](java%2F78-Subsets.java)
| [✔️](javascript%2F78-Subsets.js)
| [✔️](kotlin%2F78-Subsets.kt)
| [✔️](python%2F78-Subsets.py)
| [✔️](ruby%2F78-Subsets.rb)
| ❌
| ❌
| [✔️](swift%2F78-Subsets.swift)
| [✔️](typescript%2F78-Subsets.ts)
+[39 - Combination Sum](https://leetcode.com/problems/combination-sum/) | [✔️](c%2F392-Is-Subsequence.c)
| [✔️](cpp%2F39-Combination-Sum.cpp)
| [✔️](csharp%2F39-Combination-Sum.cs)
| [✔️](go%2F39-Combination-Sum.go)
| [✔️](java%2F39-Combination-Sum.java)
| [✔️](javascript%2F39-Combination-Sum.js)
| [✔️](kotlin%2F39-Combination-Sum.kt)
| [✔️](python%2F39-Combination-Sum.py)
| ❌
| [✔️](rust%2F392-Is-Subsequence.rs)
| ❌
| ❌
| [✔️](typescript%2F39-Combination-Sum.ts)
+[77 - Combinations](https://leetcode.com/problems/combinations/) | ❌
| [✔️](cpp%2F778-Swim-In-Rising-Water.cpp)
| [✔️](csharp%2F778-Swim-in-Rising-Water.cs)
| ❌
| [✔️](java%2F778-Swim-in-Rising-Water.java)
| [✔️](javascript%2F778-Swim-in-Rising-Water.js)
| ❌
| [✔️](python%2F77-Combinations.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[46 - Permutations](https://leetcode.com/problems/permutations/) | [✔️](c%2F463-Island-Perimeter.c)
| [✔️](cpp%2F46-Permutations.cpp)
| [✔️](csharp%2F46-Permutations.cs)
| [✔️](go%2F46-Permutations.go)
| [✔️](java%2F46-Permutations.java)
| [✔️](javascript%2F46-Permutations.js)
| [✔️](kotlin%2F46-Permutations.kt)
| [✔️](python%2F46-Permutations.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F46-Permutations.swift)
| [✔️](typescript%2F46-Permutations.ts)
+[90 - Subsets II](https://leetcode.com/problems/subsets-ii/) | ❌
| [✔️](cpp%2F90-Subsets-II.cpp)
| [✔️](csharp%2F90-Subsets-II.cs)
| [✔️](go%2F90-Subsets-II.go)
| [✔️](java%2F90-Subsets-II.java)
| [✔️](javascript%2F90-Subsets-II.js)
| [✔️](kotlin%2F90-Subsets-II.kt)
| [✔️](python%2F90-Subsets-II.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F90-Subsets-II.ts)
+[40 - Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | ❌
| [✔️](cpp%2F40-Combination-Sum-II.cpp)
| [✔️](csharp%2F40-Combination-Sum-II.cs)
| [✔️](go%2F40-Combination-Sum-II.go)
| [✔️](java%2F40-Combination-Sum-II.java)
| [✔️](javascript%2F40-Combination-Sum-II.js)
| [✔️](kotlin%2F40-Combination-Sum.kt)
| [✔️](python%2F40-Combination-Sum-II.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F40-Combination-Sum-II.ts)
+[47 - Permutations II](https://leetcode.com/problems/permutations-ii/) | ❌
| [✔️](cpp%2F473-Matchsticks-to-Square.cpp)
| ❌
| ❌
| ❌
| [✔️](javascript%2F473-Matchsticks-To-Square.js)
| ❌
| [✔️](python%2F473-Matchsticks-to-Square.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[79 - Word Search](https://leetcode.com/problems/word-search/) | [✔️](c%2F79-Word-Search.c)
| [✔️](cpp%2F79-Word-Search.cpp)
| [✔️](csharp%2F79-Word-Search.cs)
| [✔️](go%2F79-Word-Search.go)
| [✔️](java%2F79-Word-Search.java)
| [✔️](javascript%2F79-Word-Search.js)
| [✔️](kotlin%2F79-Word-Search.kt)
| [✔️](python%2F79-Word-Search.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F79-Word-Search.swift)
| ❌
+[131 - Palindrome Partitioning](https://leetcode.com/problems/palindrome-partitioning/) | ❌
| [✔️](cpp%2F131-Palindrome-Partitioning.cpp)
| [✔️](csharp%2F131-Palindrome-Partitioning.cs)
| [✔️](go%2F131-Palindrome-Partitioning.go)
| [✔️](java%2F131-Palindrome-Partitioning.java)
| [✔️](javascript%2F131-Palindrome-Partitioning.js)
| ❌
| [✔️](python%2F131-Palindrome-Partitioning.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F131-Palindrome-Partitioning.ts)
+[93 - Restore Ip Addresses](https://leetcode.com/problems/restore-ip-addresses/) | ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](javascript%2F937-K-Closest-Points-To-Origin.js)
| ❌
| [✔️](python%2F931-Minimum-Falling-Path-Sum.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[17 - Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | ❌
| [✔️](cpp%2F17-Letter-Combinations-Phone-Number.cpp)
| [✔️](csharp%2F17-Letter-Combinations-Of-A-Phone-Number.cs)
| [✔️](go%2F17-Letter-Combinations-of-a-Phone-Number.go)
| [✔️](java%2F17-Letter-Combinations-of-a-Phone-Number.java)
| [✔️](javascript%2F17-Letter-Combinations-of-a-Phone-Number.js)
| ❌
| [✔️](python%2F17-Letter-Combinations-of-a-Phone-Number.py)
| [✔️](ruby%2F17-Letter-Combinations-Of-A-Phone-Number.rb)
| ❌
| ❌
| ❌
| [✔️](typescript%2F17-Letter-Combinations-of-a-Phone-Number.ts)
+[473 - Matchsticks to Square](https://leetcode.com/problems/matchsticks-to-square/) | ❌
| [✔️](cpp%2F473-Matchsticks-to-Square.cpp)
| ❌
| ❌
| ❌
| [✔️](javascript%2F473-Matchsticks-To-Square.js)
| ❌
| [✔️](python%2F473-Matchsticks-to-Square.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1849 - Splitting a String Into Descending Consecutive Values](https://leetcode.com/problems/splitting-a-string-into-descending-consecutive-values/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F1849-Splitting-A-String-Into-Descending-Consecutive-Values.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1980 - Find Unique Binary String](https://leetcode.com/problems/find-unique-binary-string/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F1980-Find-Unique-Binary-String.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1239 - Maximum Length of a Concatenated String With Unique Characters](https://leetcode.com/problems/maximum-length-of-a-concatenated-string-with-unique-characters/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F1239-Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[698 - Partition to K Equal Sum Subsets](https://leetcode.com/problems/partition-to-k-equal-sum-subsets/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[51 - N Queens](https://leetcode.com/problems/n-queens/) | [✔️](c%2F518-Coin-Change-II.c)
| [✔️](cpp%2F51-N-Queens.cpp)
| [✔️](csharp%2F51-N-Queens.cs)
| [✔️](go%2F51-N-Queens.go)
| [✔️](java%2F51-N-Queens.java)
| [✔️](javascript%2F51-solveNQueens.js)
| ❌
| [✔️](python%2F51-N-Queens.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F518-Coin-Change-II.ts)
+[52 - N Queens II](https://leetcode.com/problems/n-queens-ii/) | [✔️](c%2F52-N-Queens-II.c)
| [✔️](cpp%2F52-N-Queens-2.cpp)
| ❌
| ❌
| [✔️](java%2F523-Continuous-Subarray-Sum.java)
| [✔️](javascript%2F52-totalNQueens.js)
| ❌
| [✔️](python%2F523-Continuous-Subarray-Sum.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+
+### Graphs
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[463 - Island Perimeter](https://leetcode.com/problems/island-perimeter/) | [✔️](c%2F463-Island-Perimeter.c)
| [✔️](cpp%2F463-Island-Perimeter.cpp)
| [✔️](csharp%2F463-Island-Perimeter.cs)
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F463-Island-Perimeter.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[953 - Verifying An Alien Dictionary](https://leetcode.com/problems/verifying-an-alien-dictionary/) | [✔️](c%2F953-Verifying-An-Alien-Dictionary.c)
| [✔️](cpp%2F953-Alien-Dictionary.cpp)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[200 - Number of Islands](https://leetcode.com/problems/number-of-islands/) | [✔️](c%2F200-Number-Of-Islands.c)
| [✔️](cpp%2F200-Number-Of-Islands.cpp)
| [✔️](csharp%2F200-Number-Of-Islands.cs)
| ❌
| [✔️](java%2F200-Number-of-Islands.java)
| [✔️](javascript%2F200-Number-of-Islands.js)
| [✔️](kotlin%2F200-Number-Of-Islands.kt)
| [✔️](python%2F200-Number-of-Islands.py)
| [✔️](ruby%2F200-Number-of-Islands.rb)
| ❌
| ❌
| [✔️](swift%2F200-Number-of-Islands.swift)
| [✔️](typescript%2F200-Number-of-Islands.ts)
+[133 - Clone Graph](https://leetcode.com/problems/clone-graph/) | [✔️](c%2F133-Clone-Graph.c)
| [✔️](cpp%2F133-Clone-Graph.cpp)
| [✔️](csharp%2F133-Clone-Graph.cs)
| [✔️](go%2F133-Clone-Graph.go)
| [✔️](java%2F133-Clone-Graph.java)
| [✔️](javascript%2F133-Clone-Graph.js)
| ❌
| [✔️](python%2F133-Clone-Graph.py)
| [✔️](ruby%2F133-Clone-Graph.rb)
| ❌
| ❌
| [✔️](swift%2F133-Clone-Graph.swift)
| [✔️](typescript%2F133-Clone-Graph.ts)
+[695 - Max Area of Island](https://leetcode.com/problems/max-area-of-island/) | [✔️](c%2F695-Max-Area-of-Island.c)
| [✔️](cpp%2F695-Max-Area-Of-Island.cpp)
| [✔️](csharp%2F695-Max-Area-of-Island.cs)
| [✔️](go%2F695-Max-Area-Of-Island.go)
| [✔️](java%2F695-Max-Area-of-Island.java)
| [✔️](javascript%2F695-Max-Area-Of-Island.js)
| [✔️](kotlin%2F695-Max-Area-Of-Island.kt)
| [✔️](python%2F695-Max-Area-of-Island.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F695-Max-Area-of-Island.ts)
+[1905 - Count Sub Islands](https://leetcode.com/problems/count-sub-islands/) | [✔️](c%2F1905-Count-Sub-Islands.c)
| ❌
| [✔️](csharp%2F1905-Count-Sub-Islands.cs)
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F1905-Count-Sub-Islands.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[417 - Pacific Atlantic Water Flow](https://leetcode.com/problems/pacific-atlantic-water-flow/) | [✔️](c%2F417-Pacific-Atlantic-Waterflow.c)
| [✔️](cpp%2F417-Pacific-Atlantic-Water-Flow.cpp)
| [✔️](csharp%2F417-Pacific-Atlantic-Water-Flow.cs)
| ❌
| [✔️](java%2F417-Pacific-Atlantic-Water-Flow.java)
| [✔️](javascript%2F417-Pacific-Atlantic-Water-Flow.js)
| [✔️](kotlin%2F417-Pacific-Atlantic-Waterflow.kt)
| [✔️](python%2F417-Pacific-Atlantic-Waterflow.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[130 - Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [✔️](c%2F130-Surrounded-Regions.c)
| [✔️](cpp%2F130-Surrounded-Regions.cpp)
| [✔️](csharp%2F130-Surrounded-Regions.cs)
| [✔️](go%2F130-Surrounded-Regions.go)
| [✔️](java%2F130-Surrounded-Regions.java)
| [✔️](javascript%2F130-Surrounded-Regions.js)
| [✔️](kotlin%2F130-Surrounded-Regions.kt)
| [✔️](python%2F130-Surrounded-Regions.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F130-Surrounded-Regions.swift)
| [✔️](typescript%2F130-Surrounded-Regions.ts)
+[1466 - Reorder Routes to Make All Paths Lead to The City Zero](https://leetcode.com/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero/) | ❌
| ❌
| [✔️](csharp%2F1466-Reorder-Routes-to-Make-All-Paths-Lead-To-The-City-Zero.cs)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[994 - Rotting Oranges](https://leetcode.com/problems/rotting-oranges/) | [✔️](c%2F994-Rotting-Oranges.c)
| [✔️](cpp%2F994-Rotting-Oranges.cpp)
| [✔️](csharp%2F994-Rotting-Oranges.cs)
| ❌
| [✔️](java%2F994-Rotting-Oranges.java)
| [✔️](javascript%2F994-Rotting-Oranges.js)
| [✔️](kotlin%2F994-Rotting-Oranges.kt)
| [✔️](python%2F994-Rotting-Oranges.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F994-Rotting-Oranges.ts)
+[286 - Walls And Gates](https://leetcode.com/problems/walls-and-gates/) | ❌
| [✔️](cpp%2F286-Walls-And-Gates.cpp)
| [✔️](csharp%2F286-Walls-and-Gates.cs)
| ❌
| [✔️](java%2F286-Walls-and-Gates.java)
| [✔️](javascript%2F286-Walls-And-Gates.js)
| ❌
| [✔️](python%2F286-Walls-and-Gates.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[909 - Snakes And Ladders](https://leetcode.com/problems/snakes-and-ladders/) | ❌
| ❌
| [✔️](csharp%2F909-Snakes-and-Ladders.cs)
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F909-Snakes-and-Ladders.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[752 - Open The Lock](https://leetcode.com/problems/open-the-lock/) | ❌
| ❌
| [✔️](csharp%2F752-Open-the-Lock.cs)
| ❌
| [✔️](java%2F752-Open-the-lock.java)
| ❌
| ❌
| [✔️](python%2F752-Open-the-Lock.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[802 - Find Eventual Safe States](https://leetcode.com/problems/find-eventual-safe-states/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[207 - Course Schedule](https://leetcode.com/problems/course-schedule/) | ❌
| [✔️](cpp%2F207-Course-Schedule.cpp)
| [✔️](csharp%2F207-Course-Schedule.cs)
| [✔️](go%2F207-Course-Schedule.go)
| [✔️](java%2F207-Course-Schedule.java)
| [✔️](javascript%2F207-Course-Schedule.js)
| [✔️](kotlin%2F207-Course-Schedule.kt)
| [✔️](python%2F207-Course-Schedule.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F207-Course-Schedule.swift)
| [✔️](typescript%2F207-Course-Schedule.ts)
+[210 - Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | ❌
| [✔️](cpp%2F210-Course-Schedule-II.cpp)
| [✔️](csharp%2F210-Course-Schedule-II.cs)
| ❌
| [✔️](java%2F210-Course-Schedule-II.java)
| [✔️](javascript%2F210-Course-Schedule-II.js)
| ❌
| [✔️](python%2F210-Course-Schedule-II.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F210-Course-Schedule-II.ts)
+[1958 - Check if Move Is Legal](https://leetcode.com/problems/check-if-move-is-legal/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[934 - Shortest Bridge](https://leetcode.com/problems/shortest-bridge/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[684 - Redundant Connection](https://leetcode.com/problems/redundant-connection/) | [✔️](c%2F684-Redundant-Connection.c)
| [✔️](cpp%2F684-Redundant-Connection.cpp)
| [✔️](csharp%2F684-Redundant-Connection.cs)
| [✔️](go%2F684-Redundant-Connection.go)
| [✔️](java%2F684-Redundant-Connection.java)
| [✔️](javascript%2F684-Redundant-Connection.js)
| [✔️](kotlin%2F684-Redundant-Connection.kt)
| [✔️](python%2F684-Redundant-Connection.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F684-Redundant-Connection.ts)
+[323 - Number of Connected Components In An Undirected Graph](https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/) | ❌
| [✔️](cpp%2F323-Number-Of-Connected-Components-In-An-Undirected-Graph.cpp)
| [✔️](csharp%2F323-Number-Of-Connected-Components-In-An-Undirected-Graph.cs)
| [✔️](go%2F323-Number-of-Connected-Components-in-an-Undirected-Graph.go)
| [✔️](java%2F323-Number-of-Connected-Components-in-an-Undirected-Graph.java)
| [✔️](javascript%2F323-countComponents.js)
| ❌
| [✔️](python%2F323-Number-of-Connected-Components-in-an-Undirected-Graph.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F323-Number-of-Connected-Components-in-an-Undirected-Graph.swift)
| ❌
+[261 - Graph Valid Tree](https://leetcode.com/problems/graph-valid-tree/) | ❌
| [✔️](cpp%2F261-Graph-Valid-Tree.cpp)
| [✔️](csharp%2F261-Graph-Valid-Tree.cs)
| ❌
| [✔️](java%2F261-Graph-Valid-Tree.java)
| [✔️](javascript%2F261-Graph-Valid-Tree.js)
| ❌
| [✔️](python%2F261-Graph-Valid-Tree.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F261-Graph-Valid-Tree.swift)
| [✔️](typescript%2F261-Graph-Valid-Tree.ts)
+[1553 - Minimum Number of Days to Eat N Oranges](https://leetcode.com/problems/minimum-number-of-days-to-eat-n-oranges/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[127 - Word Ladder](https://leetcode.com/problems/word-ladder/) | ❌
| [✔️](cpp%2F127-Word-Ladder.cpp)
| [✔️](csharp%2F127-Word-Ladder.cs)
| ❌
| [✔️](java%2F127-Word-Ladder.java)
| [✔️](javascript%2F127-Word-Ladder.js)
| [✔️](kotlin%2F127-Word-Ladder.kt)
| [✔️](python%2F127-Word-Ladder.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F127-Word-Ladder.ts)
+
+### Advanced Graphs
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[332 - Reconstruct Itinerary](https://leetcode.com/problems/reconstruct-itinerary/) | ❌
| [✔️](cpp%2F332-Reconstruct-Itinerary.cpp)
| [✔️](csharp%2F332-Reconstruct-Itinerary.cs)
| ❌
| [✔️](java%2F332-Reconstruct-Itinerary.java)
| [✔️](javascript%2F332-Reconstruct-Itinerary.js)
| [✔️](kotlin%2F332-Reconstruct-Itinerary.kt)
| [✔️](python%2F332-Reconstruct-Itinerary.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1584 - Min Cost to Connect All Points](https://leetcode.com/problems/min-cost-to-connect-all-points/) | ❌
| [✔️](cpp%2F1584-Min-Cost-To-Connect-All-Points.cpp)
| [✔️](csharp%2F1584-Min-Cost-to-Connect-All-Points.cs)
| ❌
| [✔️](java%2F1584-Min-Cost-to-Connect-All-Points.java)
| [✔️](javascript%2F1584-Min-Cost-to-Connect-all-Points.js)
| ❌
| [✔️](python%2F1584-Min-Cost-to-Connect-all-Points.py)
| [✔️](ruby%2F1584-Min-Cost-to-Connect-All-Points.rb)
| ❌
| ❌
| [✔️](swift%2F1584-Min-Cost-to-Connect-All-Points.swift)
| ❌
+[743 - Network Delay Time](https://leetcode.com/problems/network-delay-time/) | ❌
| [✔️](cpp%2F743-Network-Delay-Time.cpp)
| [✔️](csharp%2F743-Network-Delay-Time.cs)
| ❌
| [✔️](java%2F743-Network-Delay-Time.java)
| [✔️](javascript%2F743-Network-Delay-Time.js)
| ❌
| [✔️](python%2F743-Network-Delay-Time.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[778 - Swim In Rising Water](https://leetcode.com/problems/swim-in-rising-water/) | ❌
| [✔️](cpp%2F778-Swim-In-Rising-Water.cpp)
| [✔️](csharp%2F778-Swim-in-Rising-Water.cs)
| ❌
| [✔️](java%2F778-Swim-in-Rising-Water.java)
| [✔️](javascript%2F778-Swim-in-Rising-Water.js)
| ❌
| [✔️](python%2F778-Swim-in-Rising-Water.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[269 - Alien Dictionary](https://leetcode.com/problems/alien-dictionary/) | ❌
| [✔️](cpp%2F269-Alien-Dictionary.cpp)
| [✔️](csharp%2F269-Alien-Dictionary.cs)
| ❌
| [✔️](java%2F269-Alien-Dictionary.java)
| [✔️](javascript%2F269-Alien-Dictionary.js)
| ❌
| [✔️](python%2F269-Alien-Dictionary.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[787 - Cheapest Flights Within K Stops](https://leetcode.com/problems/cheapest-flights-within-k-stops/) | ❌
| [✔️](cpp%2F787-Cheapest-Flights-Within-K-Stops.cpp)
| [✔️](csharp%2F787-Cheapest-Flights-Within-K-Stops.cs)
| [✔️](go%2F787-Cheapest-Flights-Within-K-Stops.go)
| [✔️](java%2F787-Cheapest-Flights-Within-K-Stops.java)
| [✔️](javascript%2F787-Cheapest-Flights-Within-K-Stops.js)
| [✔️](kotlin%2F787-Cheapest-Flights-Within-K-Stops.kt)
| [✔️](python%2F787-Cheapest-Flights-within-K-stops.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F787-Cheapest-Flights-Within-K-Stops.ts)
+
+### 1-D Dynamic Programming
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[70 - Climbing Stairs](https://leetcode.com/problems/climbing-stairs/) | [✔️](c%2F70-Climbing-Stairs.c)
| [✔️](cpp%2F70-Climbing-Stairs.cpp)
| [✔️](csharp%2F70-Climbing-Stairs.cs)
| [✔️](go%2F70-Climbing-Stairs.go)
| [✔️](java%2F70-Climbing-Stairs.java)
| [✔️](javascript%2F70-Climbing-Stairs.js)
| [✔️](kotlin%2F70-Climbing-Stairs.kt)
| [✔️](python%2F70-Climbing-Stairs.py)
| [✔️](ruby%2F70-Climbing-Stairs.rb)
| [✔️](rust%2F70-Climbing-Stairs.rs)
| ❌
| [✔️](swift%2F70-Climbing-Stairs.swift)
| [✔️](typescript%2F70-Climbing-Stairs.ts)
+[746 - Min Cost Climbing Stairs](https://leetcode.com/problems/min-cost-climbing-stairs/) | [✔️](c%2F746-Min-Cost-Climbing-Stairs.c)
| [✔️](cpp%2F746-Min-Cost-Climbing-Stairs.cpp)
| [✔️](csharp%2F746-Min-Cost-Climbing-Stairs.cs)
| [✔️](go%2F746-Min-Cost-Climbing-Stairs.go)
| [✔️](java%2F746-Min-Cost-Climbing-Stairs.java)
| [✔️](javascript%2F746-Min-Cost-Climbing-Stairs.js)
| [✔️](kotlin%2F746-Min-Cost-Climbing-Stairs.kt)
| [✔️](python%2F746-Min-Cost-Climbing-Stairs.py)
| [✔️](ruby%2F746-Min-Cost-Climbing-Stairs.rb)
| [✔️](rust%2F746-Min-Cost-Climbing-Stairs.rs)
| ❌
| [✔️](swift%2F746-Min-Cost-Climbing-Stairs.swift)
| [✔️](typescript%2F746-Min-Cost-Climbing-Stairs.ts)
+[198 - House Robber](https://leetcode.com/problems/house-robber/) | [✔️](c%2F198-House-Robber.c)
| [✔️](cpp%2F198-House-Robber.cpp)
| [✔️](csharp%2F198-House-Robber.cs)
| [✔️](go%2F198-House-Robber.go)
| [✔️](java%2F198-House-Robber.java)
| [✔️](javascript%2F198-House-Robber.js)
| [✔️](kotlin%2F198-House-Robber.kt)
| [✔️](python%2F198-House-Robber.py)
| [✔️](ruby%2F198-House-Robber.rb)
| [✔️](rust%2F198-House-Robber.rs)
| [✔️](scala%2F198-House-Robber.scala)
| [✔️](swift%2F198-House-Robber.swift)
| [✔️](typescript%2F198-House-Robber.ts)
+[213 - House Robber II](https://leetcode.com/problems/house-robber-ii/) | [✔️](c%2F213-House-Robber-II.c)
| [✔️](cpp%2F213-House-Robber-II.cpp)
| [✔️](csharp%2F213-House-Robber-II.cs)
| [✔️](go%2F213-House-Robber-II.go)
| [✔️](java%2F213-House-Robber-II.java)
| [✔️](javascript%2F213-House-Robber-II.js)
| [✔️](kotlin%2F213-House-Robber-II.kt)
| [✔️](python%2F213-House-Robber-II.py)
| [✔️](ruby%2F213-House-Robber-II.rb)
| [✔️](rust%2F213-House-Robber-II.rs)
| [✔️](scala%2F213-House-Robber-II.scala)
| [✔️](swift%2F213-House-Robber-II.swift)
| [✔️](typescript%2F213-House-Robber-II.ts)
+[5 - Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [✔️](c%2F5-Longest-Palindromic-Substring.c)
| [✔️](cpp%2F5-Longest-Palindrome-Substring.cpp)
| [✔️](csharp%2F5-Longest-Palindromic-Substring.cs)
| [✔️](go%2F51-N-Queens.go)
| [✔️](java%2F5-Longest-Palindromic-Substring.java)
| [✔️](javascript%2F5-Longest-Palindromic-Substring.js)
| [✔️](kotlin%2F53-Maximum-Subarray.kt)
| [✔️](python%2F5-Longest-Palindromic-Substring.py)
| [✔️](ruby%2F543-Diameter-of-Binary-Tree.rb)
| [✔️](rust%2F5-Longest-Palindromic-Substring.rs)
| [✔️](scala%2F56-Merge-Intervals.scala)
| [✔️](swift%2F53-Maximum-Subarray.swift)
| [✔️](typescript%2F5-Longest-Palindromic-Substring.ts)
+[647 - Palindromic Substrings](https://leetcode.com/problems/palindromic-substrings/) | [✔️](c%2F647-Palindromic-Substrings.c)
| [✔️](cpp%2F647-Palindromic-Substrings.cpp)
| [✔️](csharp%2F647-Palindromic-Substrings.cs)
| ❌
| [✔️](java%2F647-Palindromic-Substrings.java)
| [✔️](javascript%2F647-Palindromic-Substrings.js)
| ❌
| [✔️](python%2F647-Palindromic-Substrings.py)
| ❌
| [✔️](rust%2F647-Palindromic-Substrings.rs)
| ❌
| ❌
| [✔️](typescript%2F647-Palindromic-Substrings.ts)
+[91 - Decode Ways](https://leetcode.com/problems/decode-ways/) | [✔️](c%2F91-Decode-Ways.c)
| [✔️](cpp%2F91-Decode-Ways.cpp)
| [✔️](csharp%2F91-Decode-Ways.cs)
| ❌
| [✔️](java%2F91-Decode-Ways.java)
| [✔️](javascript%2F91-Decode-Ways.js)
| [✔️](kotlin%2F91-Decode-Ways.kt)
| [✔️](python%2F91-Decode-ways.py)
| ❌
| ❌
| [✔️](scala%2F91-Decode-Ways.scala)
| ❌
| [✔️](typescript%2F91-Decode-Ways.ts)
+[322 - Coin Change](https://leetcode.com/problems/coin-change/) | [✔️](c%2F322-Coin-Change.c)
| [✔️](cpp%2F322-Coin-Change.cpp)
| [✔️](csharp%2F322-Coin-Change.cs)
| ❌
| [✔️](java%2F322-Coin-Change.java)
| [✔️](javascript%2F322-Coin-Change.js)
| [✔️](kotlin%2F322-Coin-Change.kt)
| [✔️](python%2F322-Coin-Change.py)
| ❌
| [✔️](rust%2F322-Coin-Change.rs)
| ❌
| ❌
| [✔️](typescript%2F322-Coin-Change.ts)
+[152 - Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [✔️](c%2F152-Maximum-Product-Subarray.c)
| [✔️](cpp%2F152-Maximum-Product-Subarray.cpp)
| [✔️](csharp%2F152-Maximum-Product-Subarray.cs)
| [✔️](go%2F152-Maximum-Product-Subarray.go)
| [✔️](java%2F152-Maximum-Product-Subarray.java)
| [✔️](javascript%2F152-Maximum-Product-Subarray.js)
| [✔️](kotlin%2F152-Maximum-Product-Subarray.kt)
| [✔️](python%2F152-Maximum-Product-Subarray.py)
| [✔️](ruby%2F152-Maximum-Product-Subarray.rb)
| [✔️](rust%2F152-Maximum-Product-Subarray.rs)
| ❌
| [✔️](swift%2F152-Maximum-Product-Subarray.swift)
| [✔️](typescript%2F152-Maximum-Product-Subarray.ts)
+[139 - Word Break](https://leetcode.com/problems/word-break/) | ❌
| [✔️](cpp%2F139-Word-Break.cpp)
| [✔️](csharp%2F139-Word-Break.cs)
| ❌
| ❌
| [✔️](javascript%2F139-Word-Break.js)
| ❌
| [✔️](python%2F139-Word-Break.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F139-Word-Break.ts)
+[300 - Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [✔️](c%2F300-Longest-Increasing-Subsequence.c)
| [✔️](cpp%2F300-Longest-Increasing-Subsequence.cpp)
| [✔️](csharp%2F300-Longest-Increasing-Subsequence.cs)
| ❌
| [✔️](java%2F300-Longest-Increasing-Subsequence.java)
| [✔️](javascript%2F300-Longest-Increasing-Subsequence.js)
| ❌
| [✔️](python%2F300-Longest-Increasing-Subsequence.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F300-Longest-Increasing-Subsequence.ts)
+[416 - Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | ❌
| [✔️](cpp%2F416-Partition-Equal-Subset-Sum.cpp)
| [✔️](csharp%2F416-Partition-Equal-Subset-Sum.cs)
| ❌
| [✔️](java%2F416-Partition-Equal-Subset-Sum.java)
| [✔️](javascript%2F416-Partition-Equal-Subset-Sum.js)
| ❌
| [✔️](python%2F416-Partition-Equal-Subset-Sum.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[120 - Triangle](https://leetcode.com/problems/triangle/) | ❌
| [✔️](cpp%2F120-Triangle.cpp)
| ❌
| ❌
| [✔️](java%2F120-Triangle.java)
| [✔️](javascript%2F1209-Remove-All-Adjacent-Duplicates-in-String-II.js)
| ❌
| [✔️](python%2F120-Triangle.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[740 - Delete And Earn](https://leetcode.com/problems/delete-and-earn/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[256 - Paint House](https://leetcode.com/problems/paint-house/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[377 - Combination Sum IV](https://leetcode.com/problems/combination-sum-iv/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F377-Combination-Sum-IV.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[279 - Perfect Squares](https://leetcode.com/problems/perfect-squares/) | ❌
| ❌
| ❌
| ❌
| [✔️](java%2F279-Perfect-Squares.java)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1856 - Maximum Subarray Min Product](https://leetcode.com/problems/maximum-subarray-min-product/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[983 - Minimum Cost For Tickets](https://leetcode.com/problems/minimum-cost-for-tickets/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[343 - Integer Break](https://leetcode.com/problems/integer-break/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[673 - Number of Longest Increasing Subsequence](https://leetcode.com/problems/number-of-longest-increasing-subsequence/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F673-Number-of-Longest-Increasing-Subsequence.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[691 - Stickers to Spell Word](https://leetcode.com/problems/stickers-to-spell-word/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+
+### 2-D Dynamic Programming
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[62 - Unique Paths](https://leetcode.com/problems/unique-paths/) | [✔️](c%2F62-Unique-Paths.c)
| [✔️](cpp%2F62-Unique-Paths.cpp)
| [✔️](csharp%2F62-Unique-Paths.cs)
| [✔️](go%2F62-Unique-Paths.go)
| [✔️](java%2F62-Unique-Paths.java)
| [✔️](javascript%2F62-Unique-Paths.js)
| [✔️](kotlin%2F62-Unique-Paths.kt)
| [✔️](python%2F62-Unique-Paths.py)
| ❌
| [✔️](rust%2F62-Unique-Paths.rs)
| ❌
| ❌
| [✔️](typescript%2F62-Unique-Paths.ts)
+[1143 - Longest Common Subsequence](https://leetcode.com/problems/longest-common-subsequence/) | ❌
| [✔️](cpp%2F1143-Longest-Common-Subsequence.cpp)
| [✔️](csharp%2F1143-Longest-Common-Subsequence.cs)
| [✔️](go%2F1143-Longest-Common-Subsequence.go)
| [✔️](java%2F1143-Longest-Common-Subsequence.java)
| [✔️](javascript%2F1143-Longest-Common-Subsequence.js)
| [✔️](kotlin%2F1143-Longest-Common-Subsequence.kt)
| [✔️](python%2F1143-Longest-Common-Subsequence.py)
| ❌
| [✔️](rust%2F1143-Longest-Common-Subsequence.rs)
| ❌
| [✔️](swift%2F1143-Longest-Common-Subsequence.swift)
| [✔️](typescript%2F1143-Longest-Common-Subsequence.ts)
+[309 - Best Time to Buy And Sell Stock With Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [✔️](c%2F309-Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.c)
| [✔️](cpp%2F309-Best-Time-To-Buy-And-Sell-Stock-With-Cooldown.cpp)
| [✔️](csharp%2F309-Best-Time-to-Buy-and-Sell-Stock-With-Cooldown.cs)
| [✔️](go%2F309-Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.go)
| [✔️](java%2F309-Best-Time-To-Buy-and-Sell-Stock-With-Cooldown.java)
| [✔️](javascript%2F309-Best-Time-To-Buy-And-Sell-Stock-With-Cooldown.js)
| [✔️](kotlin%2F309-Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.kt)
| [✔️](python%2F309-Best-Time-To-Buy-and-Sell-Stock-With-Cooldown.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F309-Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.swift)
| [✔️](typescript%2F309-Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.ts)
+[518 - Coin Change II](https://leetcode.com/problems/coin-change-ii/) | [✔️](c%2F518-Coin-Change-II.c)
| [✔️](cpp%2F518-Coin-Change-2.cpp)
| [✔️](csharp%2F518-Coin-Change-II.cs)
| ❌
| [✔️](java%2F518-Coin-Change-2.java)
| [✔️](javascript%2F518-Coin-Change-2.js)
| ❌
| [✔️](python%2F518-coin-change-2.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F518-Coin-Change-II.ts)
+[494 - Target Sum](https://leetcode.com/problems/target-sum/) | ❌
| [✔️](cpp%2F494-Target-Sum.cpp)
| [✔️](csharp%2F494-Target-Sum.cs)
| [✔️](go%2F494-Target-Sum.go)
| [✔️](java%2F494-Target-Sum.java)
| [✔️](javascript%2F494-Target-Sum.js)
| ❌
| [✔️](python%2F494-Target-Sum.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F494-Target-Sum.ts)
+[97 - Interleaving String](https://leetcode.com/problems/interleaving-string/) | ❌
| [✔️](cpp%2F97-Interleaving-String.cpp)
| [✔️](csharp%2F97-Interleaving-String.cs)
| ❌
| [✔️](java%2F97-Interleaving-String.java)
| [✔️](javascript%2F97-Interleaving-String.js)
| [✔️](kotlin%2F973-K-Closest-Points-To-Origin.kt)
| [✔️](python%2F97-Interleaving-Strings.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F97-Interleaving-String.ts)
+[877 - Stone Game](https://leetcode.com/problems/stone-game/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[64 - Minimum Path Sum](https://leetcode.com/problems/minimum-path-sum/) | [✔️](c%2F647-Palindromic-Substrings.c)
| [✔️](cpp%2F64-Minimum-Path-Sum.cpp)
| [✔️](csharp%2F647-Palindromic-Substrings.cs)
| ❌
| [✔️](java%2F64-Minimum-Path-Sum.java)
| [✔️](javascript%2F647-Palindromic-Substrings.js)
| ❌
| [✔️](python%2F64-Minimum-Path-Sum.py)
| ❌
| [✔️](rust%2F647-Palindromic-Substrings.rs)
| ❌
| ❌
| [✔️](typescript%2F647-Palindromic-Substrings.ts)
+[329 - Longest Increasing Path In a Matrix](https://leetcode.com/problems/longest-increasing-path-in-a-matrix/) | [✔️](c%2F329-Longest-Increasing-Path-in-a-Matrix.c)
| [✔️](cpp%2F329-Longest-Increasing-Path-In-A-Matrix.cpp)
| [✔️](csharp%2F329-Longest-Increasing-Path-in-a-Matrix.cs)
| ❌
| [✔️](java%2F329-Longest-Increasing-Path-in-a-Matrix.java)
| [✔️](javascript%2F329-Longest-Increasing-Path-in-a-Matrix.js)
| [✔️](kotlin%2F329-Longest-Increasing-Path-In-A-Matrix.kt)
| [✔️](python%2F329-Longest-Increasing-Path-in-a-Matrix.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[221 - Maximal Square](https://leetcode.com/problems/maximal-square/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F221-Maximal-Square.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[5782 - Maximum Alternating Subsequence Sum](https://leetcode.com/problems/maximum-alternating-subsequence-sum/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[115 - Distinct Subsequences](https://leetcode.com/problems/distinct-subsequences/) | ❌
| [✔️](cpp%2F115-Distinct-Subsequences.cpp)
| [✔️](csharp%2F115-Distinct-Subsequences.cs)
| ❌
| [✔️](java%2F115-Distinct-Subsequences.java)
| [✔️](javascript%2F115-Distinct-Subsequences.js)
| ❌
| [✔️](python%2F115-Distinct-Subsequences.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F115-Distinct-Subsequences.ts)
+[72 - Edit Distance](https://leetcode.com/problems/edit-distance/) | [✔️](c%2F724-Find-Pivot-Index.c)
| [✔️](cpp%2F72-Edit-Distance.cpp)
| [✔️](csharp%2F72-Edit-Distance.cs)
| ❌
| [✔️](java%2F72-Edit-Distance.java)
| [✔️](javascript%2F72-Edit-Distance.js)
| ❌
| [✔️](python%2F72-Edit-Distance.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F72-Edit-Distance.swift)
| ❌
+[1220 - Count Vowels Permutation](https://leetcode.com/problems/count-vowels-permutation/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F1220-Count-Vowels-Permutation.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[312 - Burst Balloons](https://leetcode.com/problems/burst-balloons/) | ❌
| [✔️](cpp%2F312-Burst-Balloons.cpp)
| [✔️](csharp%2F312-Burst-Balloons.cs)
| ❌
| [✔️](java%2F312-Burst-Balloons.java)
| [✔️](javascript%2F312-Burst-Balloons.js)
| ❌
| [✔️](python%2F312-Burst-Balloons.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F312-Burst-Balloons.ts)
+[1866 - Number of Ways to Rearrange Sticks With K Sticks Visible](https://leetcode.com/problems/number-of-ways-to-rearrange-sticks-with-k-sticks-visible/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[10 - Regular Expression Matching](https://leetcode.com/problems/regular-expression-matching/) | [✔️](c%2F100-Same-Tree.c)
| [✔️](cpp%2F10-Regular-Expression-Matching.cpp)
| [✔️](csharp%2F10-Regular-Expression-Matching.cs)
| [✔️](go%2F100-Same-Tree.go)
| [✔️](java%2F10-Regular-Expression-Matching.java)
| [✔️](javascript%2F10-Regular-Expression-Matching.js)
| [✔️](kotlin%2F100-Same-Tree.kt)
| [✔️](python%2F10-Regular-Expression-Matching.py)
| [✔️](ruby%2F100-Same-Tree.rb)
| ❌
| ❌
| [✔️](swift%2F100-Same-Tree.swift)
| [✔️](typescript%2F10-Regular-Expression-Matching.ts)
+
+### Greedy
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[53 - Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [✔️](c%2F53-Maximum-Subarray.c)
| [✔️](cpp%2F53-Maximum-Subarray.cpp)
| [✔️](csharp%2F53-Maximum-Subarray.cs)
| [✔️](go%2F53-Maximum-Subarray.go)
| [✔️](java%2F53-Maximum-Subarray.java)
| [✔️](javascript%2F53-Maximum-Subarray.js)
| [✔️](kotlin%2F53-Maximum-Subarray.kt)
| [✔️](python%2F53-Maximum-Subarray.py)
| ❌
| [✔️](rust%2F53-Maximum-Subarray.rs)
| ❌
| [✔️](swift%2F53-Maximum-Subarray.swift)
| [✔️](typescript%2F53-Maximum-Subarray.ts)
+[55 - Jump Game](https://leetcode.com/problems/jump-game/) | [✔️](c%2F55-Jump-Game.c)
| [✔️](cpp%2F55-Jump-Game.cpp)
| [✔️](csharp%2F55-Jump-Game.cs)
| [✔️](go%2F55-Jump-Game.go)
| [✔️](java%2F55-Jump-Game.java)
| [✔️](javascript%2F55-Jump-Game.js)
| [✔️](kotlin%2F55-Jump-Game.kt)
| [✔️](python%2F55-Jump-Game.py)
| ❌
| [✔️](rust%2F55-Jump-Game.rs)
| ❌
| [✔️](swift%2F55-Jump-Game.swift)
| [✔️](typescript%2F55-Jump-Game.ts)
+[45 - Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [✔️](c%2F45-Jump-Game-II.c)
| [✔️](cpp%2F45-Jump-Game-II.cpp)
| [✔️](csharp%2F45-Jump-Game-II.cs)
| [✔️](go%2F45-Jump-Game-II.go)
| [✔️](java%2F45-Jump-game-II.java)
| [✔️](javascript%2F45-Jump-Game-II.js)
| [✔️](kotlin%2F45-Jump-Game-II.kt)
| [✔️](python%2F45-Jump-Game-II.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F45-Jump-Game-II.swift)
| [✔️](typescript%2F45-Jump-Game-II.ts)
+[1871 - Jump Game VII](https://leetcode.com/problems/jump-game-vii/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[134 - Gas Station](https://leetcode.com/problems/gas-station/) | [✔️](c%2F134-Gas-Station.c)
| [✔️](cpp%2F134-Gas-Station.cpp)
| [✔️](csharp%2F134-Gas-Station.cs)
| [✔️](go%2F134-Gas-Station.go)
| [✔️](java%2F134-Gas-Station.java)
| [✔️](javascript%2F134-Gas-Station.js)
| [✔️](kotlin%2F134-Gas-Station.kt)
| [✔️](python%2F134-Gas-Station.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F134-Gas-Station.swift)
| [✔️](typescript%2F134-Gas-Station.ts)
+[846 - Hand of Straights](https://leetcode.com/problems/hand-of-straights/) | ❌
| [✔️](cpp%2F846-Hand-Of-Straights.cpp)
| [✔️](csharp%2F846-Hand-of-Straights.cs)
| ❌
| [✔️](java%2F846-Hand-of-Straights.java)
| [✔️](javascript%2F846-Hand-of-Straights.js)
| ❌
| [✔️](python%2F846-Hand-of-Straights.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F846-Hand-of-Straights.ts)
+[1423 - Maximum Points You Can Obtain From Cards](https://leetcode.com/problems/maximum-points-you-can-obtain-from-cards/) | ❌
| ❌
| [✔️](csharp%2F1423-Maximum-Points-You-Can-Obtain-from-Cards.cs)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1898 - Merge Triplets to Form Target Triplet](https://leetcode.com/problems/merge-triplets-to-form-target-triplet/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[763 - Partition Labels](https://leetcode.com/problems/partition-labels/) | ❌
| [✔️](cpp%2F763-Partition-Labels.cpp)
| [✔️](csharp%2F763-Partition-Labels.cs)
| [✔️](go%2F763-Partition-Labels.go)
| [✔️](java%2F763-Partition-Labels.java)
| [✔️](javascript%2F763-Partition-Labels.js)
| ❌
| [✔️](python%2F763-Partition-Labels.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[678 - Valid Parenthesis String](https://leetcode.com/problems/valid-parenthesis-string/) | [✔️](c%2F678-Valid-Parenthesis-String.c)
| [✔️](cpp%2F678-Valid-Parenthesis-String.cpp)
| [✔️](csharp%2F678-Valid-Parenthesis-String.cs)
| ❌
| [✔️](java%2F678-Valid-Parenthesis-String.java)
| [✔️](javascript%2F678-Valid-Parenthesis-String.js)
| ❌
| [✔️](python%2F678-Valid-Parenthesis-String.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F678-Valid-Parenthesis-String.ts)
+[1921 - Eliminate Maximum Number of Monsters](https://leetcode.com/problems/eliminate-maximum-number-of-monsters/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1029 - Two City Scheduling](https://leetcode.com/problems/two-city-scheduling/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+
+### Intervals
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[57 - Insert Interval](https://leetcode.com/problems/insert-interval/) | [✔️](c%2F572-Subtree-Of-Another-Tree.c)
| [✔️](cpp%2F57-Insert-Interval.cpp)
| [✔️](csharp%2F57-Insert-Interval.cs)
| [✔️](go%2F572-Subtree-of-Another-Tree.go)
| [✔️](java%2F57-Insert-Interval.java)
| [✔️](javascript%2F57-Insert-Interval.js)
| [✔️](kotlin%2F572-Subtree-Of-Another-Tree.kt)
| [✔️](python%2F57-Insert-Interval.py)
| [✔️](ruby%2F572-Subtree-of-Another-Tree.rb)
| [✔️](rust%2F57-Insert-Interval.rs)
| [✔️](scala%2F572-Subtree-of-Another-Tree.scala)
| [✔️](swift%2F57-Insert-Interval.swift)
| [✔️](typescript%2F57-Insert-Interval.ts)
+[56 - Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [✔️](c%2F567-Permutation-in-String.c)
| [✔️](cpp%2F56-Merge-Intervals.cpp)
| [✔️](csharp%2F56-Merge-Intervals.cs)
| [✔️](go%2F56-Merge-Intervals.go)
| [✔️](java%2F56-Merge-Intervals.java)
| [✔️](javascript%2F56-Merge-Intervals.js)
| [✔️](kotlin%2F56-Merge-Intervals.kt)
| [✔️](python%2F56-Merge-Intervals.py)
| ❌
| ❌
| [✔️](scala%2F56-Merge-Intervals.scala)
| ❌
| [✔️](typescript%2F56-Merge-Intervals.ts)
+[435 - Non Overlapping Intervals](https://leetcode.com/problems/non-overlapping-intervals/) | ❌
| [✔️](cpp%2F435-Non-Overlapping-Intervals.cpp)
| [✔️](csharp%2F435-Non-overlapping-Intervals.cs)
| [✔️](go%2F435-Non-Overlapping-Intervals.go)
| [✔️](java%2F435-Non-Overlapping-Intervals.java)
| [✔️](javascript%2F435-Non-overlapping-Intervals.js)
| ❌
| [✔️](python%2F435-Non-Overlapping-Intervals.py)
| ❌
| ❌
| [✔️](scala%2F435-Non-Overlapping-Intervals.scala)
| ❌
| [✔️](typescript%2F435-Non-overlapping-Intervals.ts)
+[253 - Meeting Rooms](https://leetcode.com/problems/meeting-rooms/) | ❌
| [✔️](cpp%2F253-Meeting-Rooms-II.cpp)
| [✔️](csharp%2F253-Meeting-Rooms-II.cs)
| ❌
| [✔️](java%2F253-Meeting-Rooms-ii.java)
| [✔️](javascript%2F253-Meeting-Rooms-ii.js)
| ❌
| [✔️](python%2F253-Meeting-Rooms-ii.py)
| ❌
| [✔️](rust%2F253-Meeting-Rooms.rs)
| ❌
| ❌
| ❌
+[919 - Meeting Rooms II](https://leetcode.com/problems/meeting-rooms-ii/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| [✔️](python%2F919-Meeting-Rooms-II.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1288 - Remove Covered Intervals](https://leetcode.com/problems/remove-covered-intervals/) | [✔️](c%2F1288-Remove-Covered-Intervals.c)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1851 - Minimum Interval to Include Each Query](https://leetcode.com/problems/minimum-interval-to-include-each-query/) | ❌
| [✔️](cpp%2F1851-Minimum-Interval-To-Include-Each-Query.cpp)
| [✔️](csharp%2F1851-Minimum-Interval-to-Include-Each-Query.cs)
| ❌
| [✔️](java%2F1851-Minimum-Interval-to-Include-Each-Query.java)
| ❌
| ❌
| [✔️](python%2F1851-Minimum-Interval-to-Include-Each-Query.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+
+### Math & Geometry
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[48 - Rotate Image](https://leetcode.com/problems/rotate-image/) | [✔️](c%2F48-Rotate-Image.c)
| [✔️](cpp%2F48-Rotate-Image.cpp)
| [✔️](csharp%2F48-Rotate-Image.cs)
| [✔️](go%2F48-Rotate-Image.go)
| [✔️](java%2F48-Rotate-Image.java)
| [✔️](javascript%2F48-Rotate-Image.js)
| ❌
| [✔️](python%2F48-Rotate-Image.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F48-Rotate-Image.swift)
| [✔️](typescript%2F48-Rotate-Image.ts)
+[54 - Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [✔️](c%2F543-Diameter-Of-Binary-Tree.c)
| [✔️](cpp%2F54-Spiral-Matrix.cpp)
| [✔️](csharp%2F54-Spiral-Matrix.cs)
| [✔️](go%2F543-Diameter-of-Binary-Tree.go)
| [✔️](java%2F54-Spiral-Matrix.java)
| [✔️](javascript%2F54-Spiral-Matrix.js)
| [✔️](kotlin%2F54-Spiral-Matrix.kt)
| [✔️](python%2F54-Spiral-Matrix.py)
| [✔️](ruby%2F543-Diameter-of-Binary-Tree.rb)
| ❌
| ❌
| [✔️](swift%2F543-Diameter-of-Binary-Tree.swift)
| [✔️](typescript%2F54-Spiral-Matrix.ts)
+[73 - Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [✔️](c%2F73-Set-Matrix-Zeroes.c)
| [✔️](cpp%2F73-Set-Matrix-Zeroes.cpp)
| [✔️](csharp%2F73-Set-Matrix-Zeroes.cs)
| [✔️](go%2F73-Set-Matrix-Zeroes.go)
| [✔️](java%2F73-Set-Matrix-Zeroes.java)
| [✔️](javascript%2F73-Set-Matrix-Zeroes.js)
| [✔️](kotlin%2F73-Set-Matrix-Zeros.kt)
| [✔️](python%2F73-Set-Matrix-Zeroes.py)
| [✔️](ruby%2F739-Daily-Temperatures.rb)
| ❌
| ❌
| [✔️](swift%2F739-Daily-Temperatures.swift)
| [✔️](typescript%2F73-Set-Matrix-Zeroes.ts)
+[202 - Happy Number](https://leetcode.com/problems/happy-number/) | [✔️](c%2F202-Happy-Number.c)
| [✔️](cpp%2F202-Happy-Number.cpp)
| [✔️](csharp%2F202-Happy-Number.cs)
| [✔️](go%2F202-Happy-Number.go)
| [✔️](java%2F202-Happy-Number.java)
| [✔️](javascript%2F202-Happy-Number.js)
| [✔️](kotlin%2F202-Happy-Number.kt)
| [✔️](python%2F202-Happy-Number.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F202-Happy-Number.swift)
| [✔️](typescript%2F202-Happy-Number.ts)
+[66 - Plus One](https://leetcode.com/problems/plus-one/) | [✔️](c%2F66-Plus-One.c)
| [✔️](cpp%2F66-Plus-One.cpp)
| [✔️](csharp%2F66-Plus-One.cs)
| [✔️](go%2F66-Plus-One.go)
| [✔️](java%2F66-Plus-One.java)
| [✔️](javascript%2F66-plus-one.js)
| [✔️](kotlin%2F66-Plus-One.kt)
| [✔️](python%2F66-Plus-One.py)
| ❌
| ❌
| ❌
| [✔️](swift%2F66-Plus-One.swift)
| [✔️](typescript%2F66-Plus-One.ts)
+[9 - Palindrome Number](https://leetcode.com/problems/palindrome-number/) | [✔️](c%2F91-Decode-Ways.c)
| [✔️](cpp%2F90-Subsets-II.cpp)
| [✔️](csharp%2F90-Subsets-II.cs)
| [✔️](go%2F90-Subsets-II.go)
| [✔️](java%2F90-Subsets-II.java)
| [✔️](javascript%2F9-Palindrome-Number.js)
| [✔️](kotlin%2F90-Subsets-II.kt)
| [✔️](python%2F90-Subsets-II.py)
| [✔️](ruby%2F94-Binary-Tree-Inorder-Traversal.rb)
| ❌
| [✔️](scala%2F91-Decode-Ways.scala)
| [✔️](swift%2F929-Unique-Email-Addresses.swift)
| [✔️](typescript%2F9-Palindrome-Number.ts)
+[263 - Ugly Number](https://leetcode.com/problems/ugly-number/) | [✔️](c%2F263-Ugly-Number.c)
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[1260 - Shift 2D Grid](https://leetcode.com/problems/shift-2d-grid/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[13 - Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [✔️](c%2F130-Surrounded-Regions.c)
| [✔️](cpp%2F130-Surrounded-Regions.cpp)
| [✔️](csharp%2F130-Surrounded-Regions.cs)
| [✔️](go%2F13-Roman-To-Integer.go)
| [✔️](java%2F130-Surrounded-Regions.java)
| [✔️](javascript%2F13-Roman-to-Integer.js)
| [✔️](kotlin%2F130-Surrounded-Regions.kt)
| [✔️](python%2F13-Roman-To-Integer.py)
| [✔️](ruby%2F133-Clone-Graph.rb)
| ❌
| ❌
| [✔️](swift%2F130-Surrounded-Regions.swift)
| [✔️](typescript%2F130-Surrounded-Regions.ts)
+[12 - Integer to Roman](https://leetcode.com/problems/integer-to-roman/) | [✔️](c%2F121-Best-Time-To-Buy-And-Sell-Stock.c)
| [✔️](cpp%2F120-Triangle.cpp)
| [✔️](csharp%2F121-Best-Time-To-Buy-and-Sell-Stock.cs)
| [✔️](go%2F121-Best-Time-To-Buy-And-Sell-Stock.go)
| [✔️](java%2F120-Triangle.java)
| [✔️](javascript%2F1209-Remove-All-Adjacent-Duplicates-in-String-II.js)
| [✔️](kotlin%2F121-Best-Time-to-Buy-and-Sell-Stocks.kt)
| [✔️](python%2F12-Integer-To-Roman.py)
| [✔️](ruby%2F121-Best-Time-To-Buy-and-Sell-Stock.rb)
| [✔️](rust%2F121-Best-Time-To-Buy.rs)
| ❌
| [✔️](swift%2F121-Best-Time-To-Buy-And-Sell-Stock.swift)
| [✔️](typescript%2F121-Best-Time-To-Buy-and-Sell-Stock.ts)
+[50 - Pow(x, n)](https://leetcode.com/problems/powx-n/) | [✔️](c%2F50-Pow-X-N.c)
| [✔️](cpp%2F50-Pow-X-N.cpp)
| ❌
| ❌
| ❌
| [✔️](javascript%2F50.%20Pow(x%2C%20n).js)
| ❌
| [✔️](python%2F509-Fibonacci-Number.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F50-Pow.ts)
+[43 - Multiply Strings](https://leetcode.com/problems/multiply-strings/) | ❌
| [✔️](cpp%2F43-Multiply-Strings.cpp)
| [✔️](csharp%2F43-Multiply-Strings.cs)
| [✔️](go%2F435-Non-Overlapping-Intervals.go)
| [✔️](java%2F43-Multiply-Strings.java)
| [✔️](javascript%2F43-Multiply-Strings.js)
| ❌
| [✔️](python%2F43-Multiply-Strings.py)
| ❌
| ❌
| [✔️](scala%2F435-Non-Overlapping-Intervals.scala)
| [✔️](swift%2F43-Multiply-Strings.swift)
| [✔️](typescript%2F43-Multiply-Strings.ts)
+[2013 - Detect Squares](https://leetcode.com/problems/detect-squares/) | ❌
| [✔️](cpp%2F2013-Detect-Squares.cpp)
| [✔️](csharp%2F2013-Detect-Squares.cs)
| ❌
| [✔️](java%2F2013-Detect-Squares.java)
| [✔️](javascript%2F2013-Detect-Squares.js)
| ❌
| [✔️](python%2F2013-Detect-Squares.py)
| ❌
| ❌
| ❌
| ❌
| ❌
+[1041 - Robot Bounded In Circle](https://leetcode.com/problems/robot-bounded-in-circle/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+[6 - Zigzag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [✔️](c%2F605-Can-Place-Flowers.c)
| [✔️](cpp%2F605-Can-Place-Flowers.cpp)
| [✔️](csharp%2F62-Unique-Paths.cs)
| [✔️](go%2F62-Unique-Paths.go)
| [✔️](java%2F6-Zigzag-Conversion.java)
| [✔️](javascript%2F605-can-place-flowers.js)
| [✔️](kotlin%2F62-Unique-Paths.kt)
| [✔️](python%2F605-Can-Place-Flowers.py)
| ❌
| [✔️](rust%2F62-Unique-Paths.rs)
| ❌
| [✔️](swift%2F66-Plus-One.swift)
| [✔️](typescript%2F605-Can-Place-Flowers.ts)
+[2028 - Find Missing Observations](https://leetcode.com/problems/find-missing-observations/) | ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
| ❌
+
+### Bit Manipulation
+
+Problem | C | C++ | C# | GO | Java | JS | Kotlin | Python | Ruby | Rust | Scala | Swift | TS
+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----
+[136 - Single Number](https://leetcode.com/problems/single-number/) | [✔️](c%2F136-Single-Number.c)
| [✔️](cpp%2F136-Single-Number.cpp)
| [✔️](csharp%2F136-Single-Number.cs)
| [✔️](go%2F136-Single-Number.go)
| [✔️](java%2F136-Single-Number.java)
| [✔️](javascript%2F136-Single-Number.js)
| [✔️](kotlin%2F136-Single-Number.kt)
| [✔️](python%2F136-Single-Number.py)
| [✔️](ruby%2F136-Single-Number.rb)
| ❌
| ❌
| [✔️](swift%2F136-Single-Number.swift)
| [✔️](typescript%2F136-Single-Number.ts)
+[191 - Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits/) | [✔️](c%2F191-Number-of-1-Bits.c)
| [✔️](cpp%2F191-Number-Of-1-Bits.cpp)
| [✔️](csharp%2F191-Number-Of-1-Bits.cs)
| [✔️](go%2F191-Number-of-1-Bits.go)
| [✔️](java%2F191-Number-of-1-Bits.java)
| [✔️](javascript%2F191-Number-of-1-bits.js)
| [✔️](kotlin%2F191-Number-Of-1-Bits.kt)
| [✔️](python%2F191-Number-of-1-Bits.py)
| [✔️](ruby%2F191-Number-of-1-Bits.rb)
| [✔️](rust%2F191-Number-Of-1-Bits.rs)
| ❌
| [✔️](swift%2F191-Number-of-1-Bits.swift)
| [✔️](typescript%2F191-Number-of-1-Bits.ts)
+[338 - Counting Bits](https://leetcode.com/problems/counting-bits/) | [✔️](c%2F338-Counting-Bits.c)
| [✔️](cpp%2F338-Counting-Bits.cpp)
| [✔️](csharp%2F338-Counting-Bits.cs)
| [✔️](go%2F338-Counting-Bits.go)
| [✔️](java%2F338-Counting-Bits.java)
| [✔️](javascript%2F338-Counting-Bits.js)
| [✔️](kotlin%2F338-Counting-Bits.kt)
| [✔️](python%2F338-Counting-Bits.py)
| [✔️](ruby%2F338-Counting-Bits.rb)
| [✔️](rust%2F338-Counting-Bits.rs)
| ❌
| [✔️](swift%2F338-Counting-Bits.swift)
| [✔️](typescript%2F338-Counting-Bits.ts)
+[190 - Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [✔️](c%2F190-Reverse-Bits.c)
| [✔️](cpp%2F190-Reverse-Bits.cpp)
| [✔️](csharp%2F190-Reverse-Bits.cs)
| [✔️](go%2F190-Reverse-Bits.go)
| [✔️](java%2F190-Reverse-Bits.java)
| [✔️](javascript%2F190-Reverse-Bits.js)
| [✔️](kotlin%2F190-Reverse-Bits.kt)
| [✔️](python%2F190-Reverse-Bits.py)
| [✔️](ruby%2F190-Reverse-Bits.rb)
| [✔️](rust%2F190-Reverse-Bits.rs)
| ❌
| [✔️](swift%2F190-Reverse-Bits.swift)
| [✔️](typescript%2F190-Reverse-Bits.ts)
+[268 - Missing Number](https://leetcode.com/problems/missing-number/) | [✔️](c%2F268-Missing-Number.c)
| [✔️](cpp%2F268-Missing-Number.cpp)
| [✔️](csharp%2F268-Missing-Number.cs)
| [✔️](go%2F268-Missing-Number.go)
| [✔️](java%2F268-Missing-Number.java)
| [✔️](javascript%2F268-Missing-Number.js)
| [✔️](kotlin%2F268-Missing-Number.kt)
| [✔️](python%2F268-Missing-Number.py)
| [✔️](ruby%2F268-Missing-Number.rb)
| [✔️](rust%2F268-Missing-Number.rs)
| ❌
| [✔️](swift%2F268-Missing-Number.swift)
| [✔️](typescript%2F268-Missing-Number.ts)
+[371 - Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [✔️](c%2F371-Sum-of-Two-Integers.c)
| [✔️](cpp%2F371-Sum-Of-Two-Integers.cpp)
| [✔️](csharp%2F371-Sum-Of-Two-Integers.cs)
| [✔️](go%2F371-Sum-of-Two-Integers.go)
| [✔️](java%2F371-Sum-of-Two-Integers.java)
| [✔️](javascript%2F371-Sum-of-Two-Integers.js)
| [✔️](kotlin%2F371-Sum-Of-Two-Integers.kt)
| [✔️](python%2F371-Sum-of-Two-Integers.py)
| [✔️](ruby%2F371-Sum-of-Two-Integers.rb)
| [✔️](rust%2F371-Sum-of-Two-Integers.rs)
| ❌
| [✔️](swift%2F371-Sum-Of-Two-Integers.swift)
| [✔️](typescript%2F371-Sum-Of-Two-Integers.ts)
+[7 - Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [✔️](c%2F7-Reverse-Integer.c)
| [✔️](cpp%2F7-Reverse-Integer.cpp)
| [✔️](csharp%2F7-Reverse-Integer.cs)
| [✔️](go%2F7-Reverse-Integer.go)
| [✔️](java%2F7-Reverse-Integer.java)
| [✔️](javascript%2F7-Reverse-Integer.js)
| [✔️](kotlin%2F7-Reverse-Integer.kt)
| [✔️](python%2F7-Reverse-Integer.py)
| [✔️](ruby%2F7-Reverse-Integer.rb)
| [✔️](rust%2F70-Climbing-Stairs.rs)
| [✔️](scala%2F7-Reverse-Integer.scala)
| [✔️](swift%2F7-Reverse-Integer.swift)
| [✔️](typescript%2F7-Reverse-Integer.ts)
+[67 - Add Binary](https://leetcode.com/problems/add-binary/) | [✔️](c%2F678-Valid-Parenthesis-String.c)
| [✔️](cpp%2F678-Valid-Parenthesis-String.cpp)
| [✔️](csharp%2F678-Valid-Parenthesis-String.cs)
| ❌
| [✔️](java%2F678-Valid-Parenthesis-String.java)
| [✔️](javascript%2F678-Valid-Parenthesis-String.js)
| ❌
| [✔️](python%2F673-Number-of-Longest-Increasing-Subsequence.py)
| ❌
| ❌
| ❌
| ❌
| [✔️](typescript%2F678-Valid-Parenthesis-String.ts)
+
+
+
+---
+
+Need to update the README? [Update the template instead.](README_template.md)
diff --git a/out/production/leetcode_Contribution/README_template.md b/out/production/leetcode_Contribution/README_template.md
new file mode 100644
index 000000000..fc5d3ca74
--- /dev/null
+++ b/out/production/leetcode_Contribution/README_template.md
@@ -0,0 +1,34 @@
+# Leetcode solutions for 🚀 [NeetCode.io](https://neetcode.io)
+> This repo hosts the solutions found on [NeetCode.io](https://neetcode.io) including the solutions shown on the [NeetCode YouTube channel](https://www.youtube.com/c/neetcode). The site will periodically be updated with new solutions from this repo!
+
+
+
+Solutions from these languages will be linked from [NeetCode.io](https://neetcode.io):
+* Python
+* C++
+* Java
+* Javascript
+
+Solutions are also welcome for any other *supported* language on leetcode.com!
+
+## Contributing
+**Please read the [contributing guidlines](./CONTRIBUTING.md) before opening a PR**
+
+
+To contribute, please fork this repo and open a PR adding a [missing solution](#missing-solutions) from the supported languages.
+
+If you would like to have collaborator permissions on the repo to merge your own PRs or review others' PRs please let me know.
+
+## Credits
+
+
+
+
+
+## Missing Solutions
+
+
+
+---
+
+Need to update the README? [Update the template instead.](README_template.md)
diff --git a/out/production/leetcode_Contribution/c/1-Two-Sum.c b/out/production/leetcode_Contribution/c/1-Two-Sum.c
new file mode 100644
index 000000000..ccc15633e
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/1-Two-Sum.c
@@ -0,0 +1,43 @@
+/*
+ Time: O(n)
+ Space: O(n)
+*/
+
+typedef struct {
+ int key; // key of hash_table
+ int val;
+
+ UT_hash_handle hh; // Makes this structure hashable
+} hash_table;
+
+hash_table *hash = NULL, *elem, *tmp;
+
+int* twoSum(int* nums, int numsSize, int target, int* returnSize){
+ int* res = calloc((*returnSize = 2), sizeof(int));
+
+ for(int i = 0; i < numsSize; ++i){
+ int k = target - nums[i];
+
+ HASH_FIND_INT(hash, &k, elem); // Look for the item in hash table
+
+ if (elem) {
+ res[0] = elem->val;
+ res[1] = i;
+ break;
+ }
+ else {
+ elem = malloc(sizeof(hash_table));
+ elem->key = nums[i]; // array element as key of hash table
+ elem->val = i; // index of an element as value of hash table
+
+ HASH_ADD_INT(hash, key, elem); // Add item to hash table
+ }
+ }
+
+ // Free up the hash table
+ HASH_ITER(hh, hash, elem, tmp) {
+ HASH_DEL(hash, elem); free(elem);
+ }
+
+ return res;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/100-Same-Tree.c b/out/production/leetcode_Contribution/c/100-Same-Tree.c
new file mode 100644
index 000000000..a803c8921
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/100-Same-Tree.c
@@ -0,0 +1,20 @@
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+
+
+bool isSameTree(struct TreeNode* p, struct TreeNode* q){
+ if (p == NULL && q == NULL) {
+ return true;
+ }
+ if ((p == NULL || q == NULL) || (p -> val != q -> val)) {
+ return false;
+ }
+ return (isSameTree(p -> left, q -> left) && isSameTree(p -> right, q -> right));
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/102-Binary-Tree-Level-Order-Traversal.c b/out/production/leetcode_Contribution/c/102-Binary-Tree-Level-Order-Traversal.c
new file mode 100644
index 000000000..edc2c2588
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/102-Binary-Tree-Level-Order-Traversal.c
@@ -0,0 +1,166 @@
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+
+#define ARRAY_ALLOCATION_SIZE 500
+typedef struct TreeNode TreeNode;
+
+// Circular queue with dynamic size
+typedef struct Queue
+{
+ TreeNode** treeNodeArray;
+ int treeNodeArraySize; // Allocated size of the treeNodeArray
+ int treeNodeArrayUsed; // Number of used space in the treeNodeArray
+ int front;
+ int back;
+}Queue;
+
+void queueInit(Queue* queue)
+{
+ queue->treeNodeArray = (TreeNode**)malloc(ARRAY_ALLOCATION_SIZE * sizeof(TreeNode*));
+ queue->treeNodeArraySize = ARRAY_ALLOCATION_SIZE;
+ queue->treeNodeArrayUsed = 0;
+ queue->front = -1;
+ queue->back = -1;
+}
+
+int isQueueEmpty(Queue* queue)
+{
+ if(queue->treeNodeArrayUsed == 0)
+ {
+ return true;
+ }
+
+ return false;
+}
+
+void queuePush(Queue* queue, TreeNode* node)
+{
+ // Check if space reallocation is needed
+ if(queue->treeNodeArrayUsed == queue->treeNodeArraySize)
+ {
+ // Reallocate bigger space for the array
+ queue->treeNodeArraySize += ARRAY_ALLOCATION_SIZE; // Increase the array size
+ queue->treeNodeArray = (TreeNode**)realloc(queue->treeNodeArray, queue->treeNodeArraySize * sizeof(TreeNode*));
+
+ // If the front passed the back, we need to move any element statring of the front to the end of the array
+ if(queue->front >= queue->back)
+ {
+ int oldArraySize = (queue->treeNodeArraySize - ARRAY_ALLOCATION_SIZE);
+ // Calculate how many elements we need to move, starting from the from til the array end (with old array size before reallocation)
+ int elementsToMoveCount = oldArraySize - queue->front;
+
+ for(int i = 1; i < elementsToMoveCount; i++)
+ {
+ printf("%d, %d\n", i, elementsToMoveCount);
+ queue->treeNodeArray[queue->treeNodeArraySize - i] = queue->treeNodeArray[--oldArraySize];
+ }
+
+ // Set the new front position
+ queue->front = queue->treeNodeArraySize - elementsToMoveCount;
+ }
+ }
+
+ // If back is at the end of the array, we circle back to beginning of the array
+ if(++queue->back == queue->treeNodeArraySize)
+ {
+ queue->back = 0;
+ }
+
+ // Add node at the back
+ queue->treeNodeArray[queue->back] = node;
+
+ // Increment the treeNodeArrayUsed counter
+ queue->treeNodeArrayUsed++;
+}
+
+TreeNode* queuePop(Queue* queue)
+{
+ // Make sure the queue is not empty
+ if(!isQueueEmpty(queue))
+ {
+ // Decrement the treeNodeArrayUsed counter
+ queue->treeNodeArrayUsed--;
+
+ // If front is at the end of the array, we circle back to beginning of the array
+ if(++queue->front == queue->treeNodeArraySize)
+ {
+ queue->front = 0;
+ }
+
+ return queue->treeNodeArray[queue->front];
+ }
+
+ return NULL;
+}
+
+
+/**
+ * Return an array of arrays of size *returnSize.
+ * The sizes of the arrays are returned as *returnColumnSizes array.
+ * Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().
+ */
+int** levelOrder(struct TreeNode* root, int* returnSize, int** returnColumnSizes){
+ int resultAllocatedSize = ARRAY_ALLOCATION_SIZE;
+ int** result = (int**)malloc(resultAllocatedSize * sizeof(int*));
+ int resultIndex = 0;
+ Queue queue;
+
+ // Initialize to 0
+ *returnSize = 0;
+ *returnColumnSizes = (int*)malloc(resultAllocatedSize * sizeof(int));
+
+
+ if(!root)
+ {
+ return result;
+ }
+
+ queueInit(&queue);
+ // Initialize the queue with the root node
+ queuePush(&queue, root);
+
+ while(!isQueueEmpty(&queue))
+ {
+ int levelLen = queue.treeNodeArrayUsed;
+ int* level = (int*)malloc(levelLen * sizeof(int));
+ int levelIndex = 0;
+
+ for(int i = 0; i < levelLen; i++)
+ {
+ TreeNode* poppedNode = queuePop(&queue);
+
+ level[levelIndex++] = poppedNode->val;
+ if(poppedNode->left)
+ {
+ queuePush(&queue, poppedNode->left);
+ }
+
+ if(poppedNode->right)
+ {
+ queuePush(&queue, poppedNode->right);
+ }
+ }
+
+ // Check if result array has enough space
+ if(resultIndex + 1 == resultAllocatedSize)
+ {
+ resultAllocatedSize += ARRAY_ALLOCATION_SIZE;
+
+ result = (int**)realloc(result, resultAllocatedSize * sizeof(int*));
+ *returnColumnSizes = (int*)realloc(*returnColumnSizes, resultAllocatedSize * sizeof(int));
+ }
+
+ result[resultIndex] = level;
+ (*returnColumnSizes)[resultIndex] = levelLen;
+ resultIndex++;
+ (*returnSize)++;
+ }
+
+ return result;
+}
diff --git a/out/production/leetcode_Contribution/c/104-Maximum-Depth-Of-Binary-Tree.c b/out/production/leetcode_Contribution/c/104-Maximum-Depth-Of-Binary-Tree.c
new file mode 100644
index 000000000..ee46b64a9
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/104-Maximum-Depth-Of-Binary-Tree.c
@@ -0,0 +1,28 @@
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+
+int max(int a, int b) {
+ if (a > b) {
+ return a;
+ }
+ return b;
+}
+
+
+int maxDepth(struct TreeNode* root) {
+
+ if (root == NULL) {
+ return 0;
+ }
+ return max(
+ maxDepth(root -> left),
+ maxDepth(root -> right)
+ ) + 1;
+}
+
diff --git a/out/production/leetcode_Contribution/c/105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.c b/out/production/leetcode_Contribution/c/105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.c
new file mode 100644
index 000000000..cf3ed3fea
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.c
@@ -0,0 +1,43 @@
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+typedef struct TreeNode TreeNode;
+
+TreeNode* build(int* preorder, int* inorder, int* rootIndex, int inorderLeft, int inorderRight)
+{
+ if(inorderLeft >= inorderRight)
+ {
+ return NULL;
+ }
+
+ TreeNode* root = (TreeNode*)malloc(sizeof(TreeNode));
+ root->val = preorder[*rootIndex];
+ int mid = 0;
+
+ // Finding mid
+ for(size_t i = inorderLeft; i < inorderRight; i++)
+ {
+ if(inorder[i] == preorder[*rootIndex])
+ {
+ mid = i;
+ break;
+ }
+ }
+
+ (*rootIndex)++;
+
+ root->left = build(preorder, inorder, rootIndex, inorderLeft, mid);
+ root->right = build(preorder, inorder, rootIndex, mid + 1, inorderRight);
+
+ return root;
+}
+
+struct TreeNode* buildTree(int* preorder, int preorderSize, int* inorder, int inorderSize){
+ int rootIndex = 0;
+ return build(preorder, inorder, &rootIndex, 0, inorderSize);
+}
diff --git a/out/production/leetcode_Contribution/c/108-Convert-Sorted-Array.c b/out/production/leetcode_Contribution/c/108-Convert-Sorted-Array.c
new file mode 100644
index 000000000..769e5ca9f
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/108-Convert-Sorted-Array.c
@@ -0,0 +1,22 @@
+/*
+Given an integer array nums where the elements are sorted in
+ascending order, convert it to a height-balanced binary search tree.
+
+Space: O(n)
+Time: O(n)
+*/
+
+struct TreeNode* dichomoty_rec(int* nums, int i, int j) {
+ if (i>j)
+ return NULL;
+ struct TreeNode* new_t = malloc(sizeof(struct TreeNode));
+ int m = (i+j)/2;
+ new_t->val = nums[m];
+ new_t->left = dichomoty_rec(nums, i, m-1);
+ new_t->right = dichomoty_rec(nums, m+1, j);
+ return new_t;
+}
+
+struct TreeNode* sortedArrayToBST(int* nums, int numsSize){
+ return dichomoty_rec(nums, 0, numsSize-1);
+}
diff --git a/out/production/leetcode_Contribution/c/11-Container-With-Most-Water.c b/out/production/leetcode_Contribution/c/11-Container-With-Most-Water.c
new file mode 100644
index 000000000..634d66a27
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/11-Container-With-Most-Water.c
@@ -0,0 +1,25 @@
+int maxArea(int* height, int heightSize){
+ int left = 0;
+ int right = heightSize - 1;
+ int res = 0;
+
+ while (left < right) {
+ res = max(res, min(height[left], height[right]) * (right - left));
+ if (height[left] < height[right]) {
+ left += 1;
+ }
+ else if (height[right] <= height[left]) {
+ right -= 1;
+ }
+ }
+ return res;
+}
+
+// C does not have a predefined min and max function
+int max(int a, int b) {
+ return (a > b) ? a : b;
+}
+
+int min(int a, int b) {
+ return (a < b) ? a : b;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/110-Balanced-Binary-Tree.c b/out/production/leetcode_Contribution/c/110-Balanced-Binary-Tree.c
new file mode 100644
index 000000000..23c89dd20
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/110-Balanced-Binary-Tree.c
@@ -0,0 +1,38 @@
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+
+int max(int a, int b) {
+ if (a > b) {
+ return a;
+ }
+ return b;
+}
+
+
+int height(struct TreeNode* root) {
+ if (root == NULL) {
+ return -1;
+ }
+ return max(
+ height(root -> left),
+ height(root -> right)
+ ) + 1;
+}
+
+
+bool isBalanced(struct TreeNode* root) {
+
+ if (root == NULL) {
+ return true;
+ }
+ if (abs(height(root -> left) - height(root -> right)) < 2 && isBalanced(root -> left) && isBalanced(root -> right)) {
+ return true;
+ }
+ return false;
+}
diff --git a/out/production/leetcode_Contribution/c/112-Path-Sum.c b/out/production/leetcode_Contribution/c/112-Path-Sum.c
new file mode 100644
index 000000000..f94aa9f8d
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/112-Path-Sum.c
@@ -0,0 +1,16 @@
+/*
+Given the root of a binary tree and an integer targetSum, return true
+if the tree has a root-to-leaf path such that adding up all the values
+along the path equals targetSum.
+
+Space: O(log(n)) (due to recursive calls)
+Time: O(n)
+*/
+
+bool hasPathSum(struct TreeNode* root, int targetSum){
+ if (!root)
+ return false;
+ if (!root->left && !root->right)
+ return root->val == targetSum;
+ return hasPathSum(root->left, targetSum - root->val) || hasPathSum(root->right, targetSum - root->val);
+}
diff --git a/out/production/leetcode_Contribution/c/118-Pascals-Triangle.c b/out/production/leetcode_Contribution/c/118-Pascals-Triangle.c
new file mode 100644
index 000000000..4ab56a62d
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/118-Pascals-Triangle.c
@@ -0,0 +1,24 @@
+/*
+Given an integer numRows, return the first numRows of Pascal's triangle.
+
+Space: O(n²) (n=numRows)
+Time: O(n²)
+*/
+
+int** generate(int numRows, int* returnSize, int** returnColumnSizes){
+ *returnSize = numRows;
+ (*returnColumnSizes) = malloc(sizeof(int*)*numRows);
+ int** ans = malloc(sizeof(int*)*numRows);
+ for (int i=0; i b) {
+ return b;
+ }
+ return a;
+}
+
+int max(int a, int b) {
+
+ if (a > b) {
+ return a;
+ }
+ return b;
+}
+
+int maxProfit(int* prices, int pricesSize){
+
+ int min_price = prices[0];
+ int max_profits = 0;
+
+ for (int i = 0; i < pricesSize; i++) {
+ min_price = min(min_price, prices[i]);
+ max_profits = max(prices[i] - min_price, max_profits);
+ }
+
+ return max_profits;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/122-Best-Time-to-Buy-and-Sell-Stock-II.c b/out/production/leetcode_Contribution/c/122-Best-Time-to-Buy-and-Sell-Stock-II.c
new file mode 100644
index 000000000..2d57ae455
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/122-Best-Time-to-Buy-and-Sell-Stock-II.c
@@ -0,0 +1,15 @@
+/*
+You are given an integer array prices where prices[i] is the price of a given stock on the ith day.
+Find and return the maximum profit you can achieve.
+
+Time: O(n)
+Space: O(1)
+*/
+
+int maxProfit(int* prices, int pricesSize){
+ int profit = 0; // All profit made
+ for (int i=1; ib?a:b;
+}
+
+int rec(struct TreeNode* t, int* m) { // Return the maximum path sum which uses t->Val
+ if (t==NULL)
+ return -1001;
+ int r = rec(t->right, m);
+ int l = rec(t->left, m);
+ if (t->val>0)
+ *m = max(*m, t->val+max(l+r, max(l, r)));
+ else
+ *m = max(*m, max(r, max(l, l+r+t->val)));
+ return max(0, max(l, r))+t->val;
+}
+
+int maxPathSum(struct TreeNode* root){
+ int m = root->val;
+ int c = rec(root, &m);
+ return max(c, m);
+}
diff --git a/out/production/leetcode_Contribution/c/125-Valid-Palindrome.c b/out/production/leetcode_Contribution/c/125-Valid-Palindrome.c
new file mode 100644
index 000000000..e87015add
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/125-Valid-Palindrome.c
@@ -0,0 +1,30 @@
+/*
+ Time: O(n)
+ Space: O(1)
+*/
+
+bool isPalindrome(char * s){
+ int n = strlen(s);
+ if (n==1) return true;
+
+ int left = 0;
+ int right = n-1;
+
+ while (left < right) {
+ if (isalnum(s[left]) && isalnum(s[right])) {
+ char leftChar = tolower(s[left]);
+ char rightChar = tolower(s[right]);
+
+ if (leftChar != rightChar) {
+ return false;
+ }
+ left++;
+ right--;
+ }
+
+ if (!isalnum(s[left])) left++;
+ if (!isalnum(s[right])) right--;
+ }
+
+ return true;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/1288-Remove-Covered-Intervals.c b/out/production/leetcode_Contribution/c/1288-Remove-Covered-Intervals.c
new file mode 100644
index 000000000..95ea66b13
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/1288-Remove-Covered-Intervals.c
@@ -0,0 +1,34 @@
+/*
+Given an array intervals where intervals[i] = [li, ri] represent the interval
+[li, ri), remove all intervals that are covered by another interval in the list.
+Return the number of remaining intervals.
+
+Time: O(nlog(n)) (where n is the number of intervals)
+Space: O(1)
+*/
+
+int cmp_fun(const void *const_a, const void *const_b) {
+ const int* interval_a = *(const int **)const_a;
+ const int* interval_b = *(const int **)const_b;
+ if (interval_a[0] == interval_b[0])
+ return interval_b[1] - interval_a[1];
+ else
+ return interval_a[0] - interval_b[0];
+}
+
+int removeCoveredIntervals(int** intervals, int intervalsSize, int* intervalsColSize){
+ // Sorting of intervals: a<=b ⇔ ( a[0]b[1] )
+ qsort(intervals, intervalsSize, sizeof(int*), cmp_fun);
+
+ // Treatment of intervals sorted
+ int end = 0;
+ int number_remaining = intervalsSize;
+ for (int i=0; ileft==NULL && r->right==NULL)
+ return acc*10 + r->val;
+ if (r->left==NULL)
+ return dfs(r->right, acc*10 + r->val);
+ if (r->right==NULL)
+ return dfs(r->left, acc*10 + r->val);
+ return dfs(r->right, acc*10 + r->val) + dfs(r->left, acc*10 + r->val);
+}
+
+int sumNumbers(struct TreeNode* root){
+ return dfs(root, 0);
+}
diff --git a/out/production/leetcode_Contribution/c/1299-Replace-Elements-With-Greatest-Element-On-Right-Side.c b/out/production/leetcode_Contribution/c/1299-Replace-Elements-With-Greatest-Element-On-Right-Side.c
new file mode 100644
index 000000000..3ed12545f
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/1299-Replace-Elements-With-Greatest-Element-On-Right-Side.c
@@ -0,0 +1,21 @@
+/*
+Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1.
+
+Space: O(1)
+Time: O(n)
+*/
+
+int max(int a, int b) {
+ return a>b?a:b;
+}
+
+int* replaceElements(int* arr, int arrSize, int* returnSize){
+ int greatest = -1;
+ *returnSize = arrSize;
+ for (int i=arrSize-1; i>=0; i--) {
+ int m = greatest;
+ greatest = max(greatest, arr[i]);
+ arr[i] = m;
+ }
+ return arr;
+}
diff --git a/out/production/leetcode_Contribution/c/130-Surrounded-Regions.c b/out/production/leetcode_Contribution/c/130-Surrounded-Regions.c
new file mode 100644
index 000000000..cac33df3a
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/130-Surrounded-Regions.c
@@ -0,0 +1,48 @@
+/*
+Given an m x n matrix board containing 'X' and 'O', capture all regions that are 4-directionally surrounded by 'X'.
+Time: O(n^2)
+Space: O(1)
+*/
+
+
+void dfsModifyBorder(char** board, int n, int m, int i, int j) {
+ if (board[i][j]=='X')
+ return;
+ board[i][j]='T';
+ if (i>0 && board[i-1][j]=='O')
+ dfsModifyBorder(board, n, m, i-1, j);
+ if (j>0 && board[i][j-1]=='O')
+ dfsModifyBorder(board, n, m, i, j-1);
+ if (i<(n-1) && board[i+1][j]=='O')
+ dfsModifyBorder(board, n, m, i+1, j);
+ if (j<(m-1) && board[i][j+1]=='O')
+ dfsModifyBorder(board, n, m, i, j+1);
+}
+
+void reModifyBorder(char** board, int n, int m) {
+ int i, j;
+ for (i=0; i val = val;
+ node -> numNeighbors = numNeighbors;
+ if (numNeighbors > 0) {
+ node -> neighbors = (struct Node**)malloc(numNeighbors * sizeof(struct Node*));
+ } else {
+ node -> neighbors = NULL;
+ }
+ return node;
+}
+
+struct Node* clone_node(struct Node* s, struct Node** hashset) {
+
+ if (s == NULL) return s;
+ if (hashset[(s -> val) - 1] != NULL) return hashset[(s -> val) - 1];
+
+ struct Node* new_node = create_node(s -> val, s -> numNeighbors);
+ hashset[(s -> val) - 1] = new_node;
+ for (int i = 0; i < s -> numNeighbors; i++) {
+ new_node -> neighbors[i] = clone_node(s -> neighbors[i], hashset);
+ }
+ return new_node;
+}
+
+struct Node *cloneGraph(struct Node *s) {
+
+ struct Node** hashset = (struct Node**)malloc(100 * sizeof(struct Node*));
+ for (int i = 0; i < 100; i++) {
+ hashset[i] = NULL;
+ }
+ struct Node* s_clone = clone_node(s, hashset);
+ free(hashset);
+ return s_clone;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/134-Gas-Station.c b/out/production/leetcode_Contribution/c/134-Gas-Station.c
new file mode 100644
index 000000000..f62c30621
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/134-Gas-Station.c
@@ -0,0 +1,25 @@
+int canCompleteCircuit(int* gas, int gasSize, int* cost, int costSize){
+ // Find the totalGas and totalCost
+ int totalGas = 0;
+ int totalCost = 0;
+ for (int i = 0; i < gasSize; i++) {
+ totalGas += gas[i];
+ totalCost += cost[i];
+ }
+
+ // If totalCost is more than totalGas, it is not possible to complete circuit
+ if (totalGas < totalCost) {
+ return -1;
+ }
+
+ int total = 0;
+ int result = 0;
+ for (int i = 0; i < gasSize; i++) {
+ total += gas[i] - cost[i];
+ if (total < 0) {
+ total = 0;
+ result = i + 1;
+ }
+ }
+ return result;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/136-Single-Number.c b/out/production/leetcode_Contribution/c/136-Single-Number.c
new file mode 100644
index 000000000..6e9dd99cb
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/136-Single-Number.c
@@ -0,0 +1,7 @@
+int singleNumber(int* nums, int numsSize){
+ int res = 0;
+ for (int i = 0; i < numsSize; i++) {
+ res = nums[i] ^ res;
+ }
+ return res;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/138-Copy-List-with-Random-Pointer.c b/out/production/leetcode_Contribution/c/138-Copy-List-with-Random-Pointer.c
new file mode 100644
index 000000000..d6229ae07
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/138-Copy-List-with-Random-Pointer.c
@@ -0,0 +1,89 @@
+/**
+ * Definition for a Node.
+ * struct Node {
+ * int val;
+ * struct Node *next;
+ * struct Node *random;
+ * };
+ */
+
+/*
+ Time: O(n)
+ Space: O(1)
+*/
+
+typedef struct Node Node;
+struct Node* copyRandomList(struct Node* head) {
+
+ if(head == NULL)
+ {
+ return NULL;
+ }
+
+ /**
+ * Insert each new node after each original node
+ */
+ Node* curr = head;
+ while(curr)
+ {
+ // Create the new node
+ Node* newNode = (Node*)malloc(sizeof(Node));
+ newNode->val = curr->val;
+
+ // Insert new node after the original node
+ newNode->next = curr->next;
+ curr->next = newNode;
+
+ // Move curr to the next original node
+ curr = curr->next->next;
+ }
+
+
+ /**
+ * Add the random node for each new node
+ */
+ curr = head;
+ Node* newNode = NULL;
+ while(curr)
+ {
+ // The new node is the next node to the original node
+ newNode = curr->next;
+
+ if(curr->random)
+ {
+ newNode->random = curr->random->next;
+ }
+ else
+ {
+ newNode->random = NULL;
+ }
+
+ // Move curr to the next original node
+ curr = curr->next->next;
+ }
+
+ /**
+ * Separate the original nodes list from the new nodes list
+ */
+ Node* originalList = head;
+ Node* copiedList = head->next;
+ Node* copiedListHead = head->next;
+ while(originalList)
+ {
+ originalList->next = originalList->next->next;
+ if(copiedList->next)
+ {
+ copiedList->next = copiedList->next->next;
+ }
+ else
+ {
+ copiedList->next = NULL;
+ }
+
+ originalList = originalList->next;
+ copiedList = copiedList->next;
+ }
+
+
+ return copiedListHead;
+}
diff --git a/out/production/leetcode_Contribution/c/141-Linked-List-Cycle.c b/out/production/leetcode_Contribution/c/141-Linked-List-Cycle.c
new file mode 100644
index 000000000..1a1356571
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/141-Linked-List-Cycle.c
@@ -0,0 +1,35 @@
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * struct ListNode *next;
+ * };
+ */
+
+bool Traverse(struct ListNode* slow, struct ListNode* fast) {
+
+ if (slow == NULL || slow -> next == NULL) {
+ return false;
+ }
+
+ if (fast == NULL || fast -> next == NULL) {
+ return false;
+ }
+
+ if (slow == fast) {
+ return true;
+ }
+ return Traverse(slow -> next, fast -> next -> next);
+}
+
+
+bool hasCycle(struct ListNode *head) {
+
+ if (head == NULL) {
+ return false;
+ }
+
+ return Traverse(head, head -> next);
+
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/143-Reorder-List.c b/out/production/leetcode_Contribution/c/143-Reorder-List.c
new file mode 100644
index 000000000..219bca75e
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/143-Reorder-List.c
@@ -0,0 +1,61 @@
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * struct ListNode *next;
+ * };
+ */
+
+struct ListNode* reverse(struct ListNode* head) {
+ struct ListNode* prev = NULL;
+ struct ListNode* curr = head;
+ struct ListNode* next = curr->next;
+
+ while (curr != NULL) {
+ next = curr->next;
+ curr->next = prev;
+ prev = curr;
+ curr = next;
+ }
+
+ return prev;
+}
+
+void merge(struct ListNode* l1, struct ListNode* l2) {
+ while (l1 != NULL) {
+ struct ListNode* p1 = l1->next;
+ struct ListNode* p2 = l2->next;
+
+ l1->next = l2;
+ if (p1 == NULL) {
+ break;
+ }
+ l2->next = p1;
+
+ l1 = p1;
+ l2 = p2;
+ }
+}
+
+void reorderList(struct ListNode* head){
+ if (head->next == NULL) {
+ return;
+ }
+
+ struct ListNode* prev = NULL;
+ struct ListNode* slow = head;
+ struct ListNode* fast = head;
+
+ while (fast != NULL && fast->next != NULL) {
+ prev = slow;
+ slow = slow->next;
+ fast = fast->next->next;
+ }
+
+ prev->next = NULL;
+
+ struct ListNode* l1 = head;
+ struct ListNode* l2 = reverse(slow);
+
+ merge(l1, l2);
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/1448-Count-Good-Nodes-in-Binary-Tree.c b/out/production/leetcode_Contribution/c/1448-Count-Good-Nodes-in-Binary-Tree.c
new file mode 100644
index 000000000..8d6cd8a03
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/1448-Count-Good-Nodes-in-Binary-Tree.c
@@ -0,0 +1,18 @@
+/*
+Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X.
+Return the number of good nodes in the binary tree.
+Time: O(n)
+Space: O(log(h)) Where h is the height of the tree
+*/
+
+int nbGood(struct TreeNode* root, int m) {
+ if (root==NULL)
+ return 0;
+ if (root->val >= m)
+ return 1+nbGood(root->left, root->val)+nbGood(root->right, root->val);
+ return nbGood(root->left, m)+nbGood(root->right, m);
+}
+
+int goodNodes(struct TreeNode* root){
+ return nbGood(root, INT_MIN);
+}
diff --git a/out/production/leetcode_Contribution/c/146-LRU-Cache.c b/out/production/leetcode_Contribution/c/146-LRU-Cache.c
new file mode 100644
index 000000000..192d0669b
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/146-LRU-Cache.c
@@ -0,0 +1,147 @@
+typedef struct Node {
+ int key;
+ int value;
+ struct Node* prev;
+ struct Node* next;
+ UT_hash_handle hh; /* makes this structure hashable */
+} Node;
+
+
+typedef struct {
+ int cap;
+ Node* leftMost; // LRU
+ Node* rightMost; // MRU
+} LRUCache;
+
+Node* hashedNodes = NULL;
+
+void removeNode(Node* node)
+{
+ node->prev->next = node->next;
+ node->next->prev = node->prev;
+}
+
+// Insert node at the right (MRU), just before the rightMost node
+void insertNode(Node* node, LRUCache* cache)
+{
+ Node* prev = cache->rightMost->prev;
+ Node* next = cache->rightMost;
+
+ prev->next = node;
+ next->prev = node;
+
+ node->next = next;
+ node->prev = prev;
+}
+
+
+LRUCache* lRUCacheCreate(int capacity) {
+ // Allocate space for LRUCache
+ LRUCache* cache = (LRUCache*)malloc(sizeof(LRUCache));
+
+ // Set the capacity
+ cache->cap = capacity;
+
+ // Allocate space for the leftMost and rightMost nodes
+ cache->leftMost = (Node*)malloc(sizeof(Node));
+ cache->rightMost = (Node*)malloc(sizeof(Node));
+
+ // Initialize the nodes where we connect the leftMost and rightMost to form the list
+ cache->leftMost->prev = NULL;
+ cache->leftMost->next = cache->rightMost;
+
+ cache->rightMost->prev = cache->leftMost;
+ cache->rightMost->next = NULL;
+
+ return cache;
+}
+
+int lRUCacheGet(LRUCache* obj, int key) {
+ Node* node;
+ HASH_FIND_INT(hashedNodes, &key, node);
+
+ // Check if the key exists
+ if(node)
+ {
+ // Remove the node from its current position in the list
+ removeNode(node);
+
+ // Insert the node at the right (MRU)
+ insertNode(node, obj);
+
+ return node->value;
+ }
+
+ return -1;
+}
+
+void lRUCachePut(LRUCache* obj, int key, int value) {
+ Node* node;
+ HASH_FIND_INT(hashedNodes, &key, node);
+
+ // Check if the key exists
+ if(node)
+ {
+ // Remove the node from its current position in the list
+ removeNode(node);
+
+ // Update the node's current value
+ node->value = value;
+ }
+ else
+ {
+ // Allocate space for a new node
+ node = (Node*)malloc(sizeof(Node));
+ // Initialize the node
+ node->key = key;
+ node->value = value;
+
+ // Add the new node to the hash
+ HASH_ADD_INT(hashedNodes, key, node);
+ }
+
+ // Insert the node at the right (MRU)
+ insertNode(node, obj);
+
+ // Check if we have exceeded the capacity after adding the new node
+ if(HASH_COUNT(hashedNodes) > obj->cap)
+ {
+ Node* LRUNode = obj->leftMost->next;
+
+ // Remove the left node (LRU) from the list
+ removeNode(LRUNode);
+
+ // Remove the node from the hash
+ HASH_DEL(hashedNodes, LRUNode);
+
+ // Deallocate the node
+ free(LRUNode);
+ }
+}
+
+void lRUCacheFree(LRUCache* obj) {
+ // Deallocate the nodes first
+ free(obj->leftMost);
+ free(obj->rightMost);
+
+ // Deallocate the LRUCache
+ free(obj);
+
+ // Delete and deallocate all the nodes from the hash
+ Node *currentNode, *tmp;
+
+ HASH_ITER(hh, hashedNodes, currentNode, tmp) {
+ HASH_DEL(hashedNodes, currentNode); /* delete; nodes advances to next */
+ free(currentNode);
+ }
+}
+
+/**
+ * Your LRUCache struct will be instantiated and called as such:
+ * LRUCache* obj = lRUCacheCreate(capacity);
+ * int param_1 = lRUCacheGet(obj, key);
+
+ * lRUCachePut(obj, key, value);
+
+ * lRUCacheFree(obj);
+*/
diff --git a/out/production/leetcode_Contribution/c/150-Evaluate-Reverse-Polish-Notation.c b/out/production/leetcode_Contribution/c/150-Evaluate-Reverse-Polish-Notation.c
new file mode 100644
index 000000000..8918ab206
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/150-Evaluate-Reverse-Polish-Notation.c
@@ -0,0 +1,51 @@
+int evalRPN(char ** tokens, int tokensSize){
+ long int stk[tokensSize];
+
+ int stkIndex = -1;
+
+ for(int i = 0; i < tokensSize; i++)
+ {
+ if(strcmp(tokens[i], "+") == 0)
+ {
+ int first = stk[stkIndex];
+ stkIndex--;
+ int second = stk[stkIndex];
+
+ stk[stkIndex] = first + second;
+ }
+ else if(strcmp(tokens[i], "-") == 0)
+ {
+ int first = stk[stkIndex];
+ stkIndex--;
+ int second = stk[stkIndex];
+
+ stk[stkIndex] = second - first;
+ }
+ else if(strcmp(tokens[i], "*") == 0)
+ {
+ long first = stk[stkIndex];
+ stkIndex--;
+ int second = stk[stkIndex];
+
+ stk[stkIndex] = first * second;
+
+ }
+ else if(strcmp(tokens[i], "/") == 0)
+ {
+ int first = stk[stkIndex];
+ stkIndex--;
+ int second = stk[stkIndex];
+
+ stk[stkIndex] = second / first;
+ }
+ else
+ {
+ stkIndex++;
+ stk[stkIndex] = atoi(tokens[i]);
+ }
+
+ }
+
+
+ return stk[stkIndex];
+}
diff --git a/out/production/leetcode_Contribution/c/152-Maximum-Product-Subarray.c b/out/production/leetcode_Contribution/c/152-Maximum-Product-Subarray.c
new file mode 100644
index 000000000..d294228ba
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/152-Maximum-Product-Subarray.c
@@ -0,0 +1,21 @@
+int maxProduct(int* nums, int numsSize){
+ int res = nums[0], curMin = 1, curMax = 1;
+
+ for (int i = 0; i < numsSize; i++) {
+ int temp = curMax * nums[i];
+ curMax = max(max(nums[i] * curMax, nums[i] * curMin), nums[i]);
+ curMin = min(min(temp, nums[i] * curMin), nums[i]);
+ res = max(res, curMax);
+ }
+ return res;
+}
+
+// C doesn't have a built-in max function
+int max(int a, int b) {
+ return (a > b) ? a : b;
+}
+
+// C doesn't have a built-in min function
+int min(int a, int b) {
+ return (a < b) ? a : b;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/153-Find-Minimum-in-Rotated-Sorted-Array.c b/out/production/leetcode_Contribution/c/153-Find-Minimum-in-Rotated-Sorted-Array.c
new file mode 100644
index 000000000..e2d05adaf
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/153-Find-Minimum-in-Rotated-Sorted-Array.c
@@ -0,0 +1,19 @@
+int findMin(int* nums, int numsSize){
+ // set the starting indicies to find minimum pivot
+ int left = 0;
+ int right = numsSize - 1;
+
+ while (left < right) {
+ // calculate middle index
+ int middle = (left + right) / 2;
+
+ // set the left or right index accordingly
+ if (nums[middle] > nums[right]) {
+ left = middle + 1;
+ }
+ else {
+ right = middle;
+ }
+ }
+ return nums[left];
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/167-Two-Sum-II.c b/out/production/leetcode_Contribution/c/167-Two-Sum-II.c
new file mode 100644
index 000000000..3d95cbecb
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/167-Two-Sum-II.c
@@ -0,0 +1,28 @@
+
+/*
+ Given a 1-indexed sorted int array & target:
+ Return indices (added by 1) of 2 nums that add to target
+ 2 pointers, outside in, iterate i/j if sum is too low/high
+ Time: O(n)
+ Space: O(1)
+*/
+
+int* twoSum(int* numbers, int numbersSize, int target, int* returnSize){
+ *returnSize = 2;
+ int* ans = malloc(sizeof(int)*2);
+
+ int i = 0;
+ int j = numbersSize-1;
+ int k;
+ while (true) {
+ k = numbers[i]+numbers[j]-target;
+ if (k==0) { // numbers[i]+numbers[j] = target
+ ans[0] = i+1;
+ ans[1] = j+1;
+ return ans;
+ } else if (k>0) // numbers[i]+numbers[j] > target
+ j--;
+ else // numbers[i]+numbers[j] < target
+ i++;
+ }
+}
diff --git a/out/production/leetcode_Contribution/c/169-Majority-Element.c b/out/production/leetcode_Contribution/c/169-Majority-Element.c
new file mode 100644
index 000000000..264a31e27
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/169-Majority-Element.c
@@ -0,0 +1,23 @@
+/*
+Given an array nums of size n, return the majority element.
+
+Space: O(1)
+Time: O(n)
+*/
+
+int majorityElement(int* nums, int numsSize){
+ int candidate=nums[0];
+ int count=1;
+ for (int i=1; inext == NULL) {
+ return head->next;
+ }
+
+ struct ListNode* slow = head;
+ struct ListNode* fast = head;
+
+ while (n--) {
+ fast = fast->next;
+ }
+
+ if (fast != NULL) {
+ while (fast->next != NULL) {
+ slow = slow->next;
+ fast = fast->next;
+ }
+ slow->next = slow->next->next;
+ }
+ else {
+ slow->val = slow->next->val;
+ slow->next = slow->next->next;
+ }
+
+ return head;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/190-Reverse-Bits.c b/out/production/leetcode_Contribution/c/190-Reverse-Bits.c
new file mode 100644
index 000000000..ed5fd3d01
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/190-Reverse-Bits.c
@@ -0,0 +1,10 @@
+uint32_t reverseBits(uint32_t n) {
+ uint32_t res = 0;
+
+ for (int i = 0; i < 32; i++) {
+ res <<= 1;
+ res |= n & 1;
+ n >>= 1;
+ }
+ return res;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/1905-Count-Sub-Islands.c b/out/production/leetcode_Contribution/c/1905-Count-Sub-Islands.c
new file mode 100644
index 000000000..c0da237c0
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/1905-Count-Sub-Islands.c
@@ -0,0 +1,35 @@
+/*
+
+Space: O(n²) (due to recursives calls)
+Time: O(n²)
+*/
+
+bool dfs_test(int** grid1, int** grid2, int i, int j, int n, int m) {
+ // Test if the island in grid2 is entirely in grid1 and delete the island in grid2
+ bool ans = (grid1[i][j] == 1);
+ grid2[i][j] = 0;
+ if (i>0 && grid2[i-1][j]==1)
+ ans = dfs_test(grid1, grid2, i-1, j, n ,m) && ans;
+ if (j>0 && grid2[i][j-1]==1)
+ ans = dfs_test(grid1, grid2, i, j-1, n ,m) && ans;
+ if (i<(n-1) && grid2[i+1][j]==1)
+ ans = dfs_test(grid1, grid2, i+1, j, n ,m) && ans;
+ if (j<(m-1) && grid2[i][j+1]==1)
+ ans = dfs_test(grid1, grid2, i, j+1, n ,m) && ans;
+ return ans;
+}
+
+int countSubIslands(int** grid1, int grid1Size, int* grid1ColSize, int** grid2, int grid2Size, int* grid2ColSize){
+ int cpt=0;
+ for (int i=0; i> 1;
+ }
+ return res;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/1968-Array-Not-Average-Neighbors.c b/out/production/leetcode_Contribution/c/1968-Array-Not-Average-Neighbors.c
new file mode 100644
index 000000000..2b36edcc5
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/1968-Array-Not-Average-Neighbors.c
@@ -0,0 +1,26 @@
+/*
+You want to rearrange the elements in the array such that every element
+in the rearranged array is not equal to the average of its neighbors
+
+Space: O(n)
+Time: O(nlog(n)) (quicksort)
+*/
+
+int cmp(const void* a, const void* b) {
+ return *(int*)a - *(int*)b;
+}
+int* rearrangeArray(int* nums, int numsSize, int* returnSize){
+ int* ans = malloc(sizeof(int)*numsSize);
+ *returnSize = numsSize;
+ qsort(nums, numsSize, sizeof(int), cmp);
+ int i, j=0;
+ for (i=1; i way2) {
+ dp[n] = way1;
+ }
+ else {
+ dp[n] = way2;
+ }
+
+ return dp[n];
+}
+
+int rob(int* nums, int numsSize){
+
+ // Initializing the dp array with initial value -1.
+ for(int i = 0; i < 105; i++){
+ dp[i] = -1 ;
+ }
+
+ return solve(nums, numsSize - 1);
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/199-Binary-Tree-Right-Side-View.c b/out/production/leetcode_Contribution/c/199-Binary-Tree-Right-Side-View.c
new file mode 100644
index 000000000..338d3b0c3
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/199-Binary-Tree-Right-Side-View.c
@@ -0,0 +1,57 @@
+/*
+ Given a binary tree, return the right side view of it (the nodes which can
+ be seen in front when looking from the right).
+ Ex. 1 <-
+ / \
+ 2 3 <- -> [1, 3, 4]
+ \ \
+ 5 4 <-
+
+
+ The right side view is basically the last element at each level of the tree.
+ So BFS is one way this problem can be solved.
+
+ The solution below uses recursion, where on reaching a new depth we add that
+ node as the right view for that depth. We recursively visit the right child
+ before the left child to get the right view.
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+
+void dfs(struct TreeNode* root, int* result, int* returnSize, int depth) {
+ if (root == NULL)
+ return;
+
+ // If a new depth is reached, add the node as right view for that depth
+ if (*returnSize <= depth) {
+ *returnSize += 1;
+ result[depth] = root->val;
+ }
+
+ // Visit the right child first then left child
+ dfs(root->right, result, returnSize, depth+1);
+ dfs(root->left, result, returnSize, depth+1);
+}
+
+/**
+ * Note: The returned array must be malloced, assume caller calls free().
+ */
+int* rightSideView(struct TreeNode* root, int* returnSize) {
+ // Size of result array depends on the depth of tree, which can be precomputed
+ int* result = (int*) malloc(sizeof(int)*100);
+ *returnSize = 0;
+
+ dfs(root, result, returnSize, 0);
+
+ return result;
+}
diff --git a/out/production/leetcode_Contribution/c/2-Add-Two-Numbers.c b/out/production/leetcode_Contribution/c/2-Add-Two-Numbers.c
new file mode 100644
index 000000000..b3e5a1194
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/2-Add-Two-Numbers.c
@@ -0,0 +1,67 @@
+/*
+ Given two linked lists where the nodes represent the digits of two numbers,
+ add the numbers together and return the sum as a linked list.
+ Ex. l1 = [2,4,3],
+ l2 = [5,6,4] -> [7,0,8]
+
+ Traverse the linked lists and add the values of the corresponding nodes, if
+ the sum is greater than 10, carry is present and will be added along with
+ the next pair of digits. The lengths of the lists may differ, so check if
+ the nodes are not null, before adding.
+
+ Time: O(max(m, n)) where m, n are lengths of l1 and l2 respectively
+ Space: O(max(m, n))
+*/
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * struct ListNode *next;
+ * };
+ */
+struct ListNode* newNode(int val) {
+ struct ListNode* node = (struct ListNode*) malloc(sizeof(struct ListNode));
+ node->val = val;
+ node->next = NULL;
+
+ return node;
+}
+
+struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2){
+ struct ListNode* head = NULL;
+ struct ListNode* curr = NULL;
+
+ int carry = 0;
+
+ while (l1 || l2) {
+ int sum = carry;
+
+ if (l1)
+ sum += l1->val;
+ if (l2)
+ sum += l2->val;
+
+ carry = sum/10;
+ sum %= 10;
+
+ if (head == NULL) {
+ head = newNode(sum);
+ curr = head;
+ } else {
+ curr->next = newNode(sum);
+ curr = curr->next;
+ }
+
+ if (l1)
+ l1 = l1->next;
+ if (l2)
+ l2 = l2->next;
+ }
+
+ if (carry)
+ curr->next = newNode(carry);
+
+
+ return head;
+}
diff --git a/out/production/leetcode_Contribution/c/20-Valid-Parentheses.c b/out/production/leetcode_Contribution/c/20-Valid-Parentheses.c
new file mode 100644
index 000000000..8bece2ead
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/20-Valid-Parentheses.c
@@ -0,0 +1,80 @@
+
+struct Node {
+ char val;
+ struct Node* next;
+};
+
+struct Stack {
+ struct Node* head;
+ size_t len;
+};
+
+struct Node* Node(char val, struct Node* next) {
+ struct Node* root = (struct Node*)malloc(sizeof(struct Node));
+ root -> next = next;
+ root -> val = val;
+ return root;
+}
+
+struct Stack* Stack() {
+ struct Stack* stack = (struct Stack*)malloc(sizeof(struct Stack));
+ stack -> len = 0;
+ stack -> head = NULL;
+ return stack;
+}
+
+void append(struct Stack* stack, char val) {
+ struct Node* node = Node(val, stack -> head);
+ stack -> head = node;
+ stack -> len += 1;
+}
+
+char pop(struct Stack* stack) {
+ if (stack -> head == NULL) {
+ return NULL;
+ }
+ char val = stack -> head -> val;
+ struct Node* deleteNode = stack -> head;
+ stack -> head = stack -> head -> next;
+ stack -> len -= 1;
+ free(deleteNode);
+ return val;
+}
+
+void freeStack(struct Stack* stack) {
+ while (pop(stack) != NULL) {
+ pop(stack);
+ }
+ free(stack);
+}
+
+char opposite_parenthesis(char closing) {
+ char opening = NULL;
+ if (closing == ')') {
+ opening = '(';
+ } else if (closing == '}') {
+ opening = '{';
+ } else if (closing == ']') {
+ opening = '[';
+ }
+ return opening;
+}
+
+bool isValid(char * s){
+
+ struct Stack* stack = Stack();
+ char* chr;
+
+ for (chr = s; *chr != '\0'; chr++) {
+ if (opposite_parenthesis(*chr) == NULL) {
+ append(stack, *chr);
+ } else if (stack -> len != 0 && opposite_parenthesis(*chr) == pop(stack)) {
+ continue;
+ } else {
+ return false;
+ }
+ }
+ bool result = stack -> len == 0;
+ freeStack(stack);
+ return result;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/200-Number-Of-Islands.c b/out/production/leetcode_Contribution/c/200-Number-Of-Islands.c
new file mode 100644
index 000000000..701e371bd
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/200-Number-Of-Islands.c
@@ -0,0 +1,39 @@
+
+
+int directions[][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
+
+void searchIsland(int row, int col, int rows, int cols, char** grid) {
+ if ( row >= 0 && col >= 0 && row < rows && col < cols && grid[row][col] == '1') {
+ for (int i = 0; i < 4; i++) {
+ searchIsland(row + directions[i][0], col + directions[i][1], rows, cols, grid);
+ grid[row][col] = '0';
+ }
+ }
+}
+
+
+int numIslands(char** grid, int gridSize, int* gridColSize){
+
+ int rows = gridSize;
+ int cols = gridColSize[0];
+
+ int IslandCount = 0;
+
+ for (int row = 0; row < rows; row++) {
+ for (int col = 0; col < cols; col++) {
+ if (grid[row][col] == '1') {
+ searchIsland(row, col, rows, cols, grid);
+ IslandCount++;
+ }
+ }
+ }
+ return IslandCount;
+}
+
+
+
+
+// int numIslands(char** grid, int gridSize, int* gridColSize){
+// printf("%c", grid[0][4]);
+// return 0;
+// }
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/202-Happy-Number.c b/out/production/leetcode_Contribution/c/202-Happy-Number.c
new file mode 100644
index 000000000..7cb975c94
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/202-Happy-Number.c
@@ -0,0 +1,20 @@
+bool isHappy(int n) {
+ int slow = n;
+ int fast = sumSquareDigits(n);
+
+ while (slow != fast) {
+ fast = sumSquareDigits(sumSquareDigits(fast));
+ slow = sumSquareDigits(slow);
+ }
+ return fast == 1;
+}
+
+int sumSquareDigits(n) {
+ int result = 0;
+ while (n != 0) {
+ int digit = n % 10;
+ result += digit * digit;
+ n /= 10;
+ }
+ return result;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/205-Isomorphic-Strings.c b/out/production/leetcode_Contribution/c/205-Isomorphic-Strings.c
new file mode 100644
index 000000000..4f2fc50bc
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/205-Isomorphic-Strings.c
@@ -0,0 +1,35 @@
+/*
+Given two strings s and t, determine if they are isomorphic.
+
+Space: O(1)
+Time: O(n)
+*/
+
+bool isIsomorphic(char * s, char * t){
+ int alphabet_s[256]; // Alphabet of t letters to s
+ int alphabet_t[256]; // Alphabet of s letters to t
+ for (int i=0; i<256; i++){ // Fill alphabets with empty values
+ alphabet_s[i] = -1;
+ alphabet_t[i] = -1;
+ }
+ int i; // To be able to use it outside the loop for
+ for (i=0; s[i]!='\0'; i++) {
+ if (alphabet_t[s[i]]==-1 && alphabet_s[t[i]]==-1) {
+ alphabet_t[s[i]] = t[i];
+ alphabet_s[t[i]] = s[i];
+ } else if (alphabet_t[s[i]]==-1) {
+ if (alphabet_s[t[i]] != s[i]) {
+ return false;
+ }
+ alphabet_t[s[i]] = t[i];
+ } else if (alphabet_s[t[i]]==-1) {
+ if (alphabet_t[s[i]] != t[i]) {
+ return false;
+ }
+ alphabet_s[t[i]] = s[i];
+ } else if (alphabet_t[s[i]] != t[i] || alphabet_s[t[i]] != s[i]) {
+ return false;
+ }
+ }
+ return t[i]=='\0';
+}
diff --git a/out/production/leetcode_Contribution/c/206-Reverse-Linked-List.c b/out/production/leetcode_Contribution/c/206-Reverse-Linked-List.c
new file mode 100644
index 000000000..79e832d21
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/206-Reverse-Linked-List.c
@@ -0,0 +1,24 @@
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * struct ListNode *next;
+ * };
+ */
+
+
+struct ListNode* reverseList(struct ListNode* head){
+
+ if (head == NULL) {
+ return NULL;
+ } else if (head -> next == NULL) {
+ return head;
+ }
+
+ struct ListNode* lastNode = reverseList(head -> next);
+ head -> next -> next = head;
+ head -> next = NULL;
+ return lastNode;
+
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/208-Implement-Trie-Prefix-Tree.c b/out/production/leetcode_Contribution/c/208-Implement-Trie-Prefix-Tree.c
new file mode 100644
index 000000000..1a6b16c03
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/208-Implement-Trie-Prefix-Tree.c
@@ -0,0 +1,108 @@
+
+// struct trieNode {
+// struct trieNode* nextNodes[26];
+// bool end;
+// };
+
+typedef struct {
+ struct Trie* nextNodes[26]; /* a Trie* pointer array of size 26 to store char nodes from a to z*/
+ bool end; /* a boolean to mark the end of word */
+} Trie;
+
+// Create a trie node using malloc.
+Trie* trieCreate() {
+ Trie* root = (Trie*)malloc(sizeof(Trie));
+ for (int i = 0; i < 26; i++) {
+ root -> nextNodes[i] = NULL;
+ }
+ root -> end = false;
+ return root;
+}
+
+// Get the next character node from the current trie node.
+Trie* get_node(Trie* node, char character) {
+ int index = character - 97;
+ Trie* nextNode = node -> nextNodes[index];
+ return nextNode;
+}
+
+// Add a new character node to the current trie node.
+void add_node(Trie* node, char character, Trie* newNode) {
+ int index = character - 97;
+ node -> nextNodes[index] = newNode;
+ return;
+}
+
+// Insert implementation in recursion.
+void insert_recur(Trie* node, int idx, char * word, int wordSize) {
+ if (idx == wordSize) {
+ node -> end = true;
+ return;
+ }
+ if (get_node(node, word[idx]) == NULL) {
+ add_node(node, word[idx], trieCreate());
+ }
+ return insert_recur(get_node(node, word[idx]), idx + 1, word, wordSize);
+}
+
+// Insert method.
+void trieInsert(Trie* obj, char * word) {
+ insert_recur(obj, 0, word, strlen(word));
+ return;
+}
+
+// Search implementation in recursion.
+bool trieSearch_recur(Trie* node, int idx, char * word, int wordSize) {
+ if (idx == wordSize) {
+ return node -> end;
+ }
+ if (get_node(node, word[idx]) == NULL) {
+ return false;
+ }
+ return trieSearch_recur(get_node(node, word[idx]), idx + 1, word, wordSize);
+}
+
+// Search method.
+bool trieSearch(Trie* obj, char * word) {
+ return trieSearch_recur(obj, 0, word, strlen(word));
+}
+
+// prefix search implementation in recursion.
+bool trieStartsWith_recur(Trie* node, int idx, char * prefix, int prefixSize) {
+ if (idx == prefixSize) {
+ return true;
+ }
+ if (get_node(node, prefix[idx]) == NULL) {
+ return false;
+ }
+ return trieStartsWith_recur(get_node(node, prefix[idx]), idx + 1, prefix, prefixSize);
+}
+
+// prefix search method.
+bool trieStartsWith(Trie* obj, char * prefix) {
+ return trieStartsWith_recur(obj, 0, prefix, strlen(prefix));
+}
+
+// free method to free up memory of all the nodes.
+void trieFree(Trie* obj) {
+ if (obj == NULL) {
+ return;
+ }
+ for (char i = 97; i < 123; i++) {
+ trieFree(get_node(obj, i));
+ }
+ free(obj);
+ return;
+}
+
+/**
+ * Your Trie struct will be instantiated and called as such:
+ * Trie* obj = trieCreate();
+ * trieInsert(obj, word);
+
+ * bool param_2 = trieSearch(obj, word);
+
+ * bool param_3 = trieStartsWith(obj, prefix);
+
+ * trieFree(obj);
+*/
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/209-Minimum-Size-Subarray-Sum.c b/out/production/leetcode_Contribution/c/209-Minimum-Size-Subarray-Sum.c
new file mode 100644
index 000000000..d72919ef1
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/209-Minimum-Size-Subarray-Sum.c
@@ -0,0 +1,32 @@
+/*
+Given an array of positive integers nums and a positive integer target, return
+the minimal length of a contiguous subarray of which the sum is greater than or
+equal to target
+
+Space: O(1)
+Time: O(n)
+*/
+
+int min(int a, int b) {
+ return a=target) {
+ if (len==0)
+ len = j-i+1;
+ while (cpt-nums[i] >= target) {
+ cpt -= nums[i];
+ len = min(len, j-i);
+ i++;
+ }
+ }
+ j++;
+ }
+ return len;
+}
diff --git a/out/production/leetcode_Contribution/c/21-Merge-Two-Sorted-Lists.c b/out/production/leetcode_Contribution/c/21-Merge-Two-Sorted-Lists.c
new file mode 100644
index 000000000..7ee608d9c
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/21-Merge-Two-Sorted-Lists.c
@@ -0,0 +1,46 @@
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * struct ListNode *next;
+ * };
+ */
+
+
+struct ListNode* mergeTwoLists(struct ListNode* list1, struct ListNode* list2){
+
+ if (list1 == NULL && list2 == NULL) {
+ return NULL;
+ } else if (list1 != NULL && list2 == NULL) {
+ return list1;
+ } else if (list2 != NULL && list1 == NULL) {
+ return list2;
+ }
+
+ struct ListNode* temp_node = NULL;
+
+ if (list1 -> val < list2 -> val) {
+ temp_node = list1;
+ list1 = list1 -> next;
+ } else {
+ temp_node = list2;
+ list2 = list2 -> next;
+ }
+
+ struct ListNode* root = temp_node;
+
+ while((list1 != NULL) || (list2 != NULL)) {
+
+ if ((list2 == NULL) || ((list1 != NULL) && (list1 -> val < list2 -> val))) {
+ temp_node -> next = list1;
+ list1 = list1 -> next;
+ } else {
+ temp_node -> next = list2;
+ list2 = list2 -> next;
+ }
+ temp_node = temp_node -> next;
+ }
+
+ return root;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/213-House-Robber-II.c b/out/production/leetcode_Contribution/c/213-House-Robber-II.c
new file mode 100644
index 000000000..c1656e705
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/213-House-Robber-II.c
@@ -0,0 +1,25 @@
+int rob(int* nums, int numsSize){
+ int n = numsSize;
+
+ if (n == 1) {
+ return nums[0];
+ }
+
+ int range1 = robber(nums, 0, n - 2);
+ int range2 = robber(nums, 1, n - 1);
+
+ return (range1 > range2) ? range1 : range2;
+}
+
+int robber(int* nums, int start, int end) {
+ int prev = 0;
+ int curr = 0;
+ int next = 0;
+
+ for (int i = start; i <= end; i++) {
+ next = (curr > prev + nums[i]) ? curr : prev + nums[i];
+ prev = curr;
+ curr = next;
+ }
+ return curr;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/217-Contains-Duplicate.c b/out/production/leetcode_Contribution/c/217-Contains-Duplicate.c
new file mode 100644
index 000000000..d60fab49b
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/217-Contains-Duplicate.c
@@ -0,0 +1,42 @@
+/*
+ Time: O(n)
+ Space: O(1)
+*/
+
+typedef struct {
+ int key;
+ UT_hash_handle hh; // Makes this structure hashable
+} hash_table;
+
+hash_table *hash = NULL, *elem, *tmp;
+
+bool containsDuplicate(int* nums, int numsSize){
+ if (numsSize == 1) {
+ return false;
+ }
+
+ bool flag = false;
+
+ for (int i=0; ikey = nums[i];
+ HASH_ADD_INT(hash, key, elem);
+
+ flag = false;
+ }
+ else {
+ flag = true;
+ break;
+ }
+ }
+
+ // Free up the hash table
+ HASH_ITER(hh, hash, elem, tmp) {
+ HASH_DEL(hash, elem); free(elem);
+ }
+
+ return flag;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/226-Invert-Binary-Tree.c b/out/production/leetcode_Contribution/c/226-Invert-Binary-Tree.c
new file mode 100644
index 000000000..5a3612cb0
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/226-Invert-Binary-Tree.c
@@ -0,0 +1,20 @@
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+
+struct TreeNode *invertTree(struct TreeNode* root) {
+
+ if (root == NULL) {
+ return root;
+ }
+ struct TreeNode* inverted_right = invertTree(root -> right);
+ struct TreeNode* inverted_left = invertTree(root -> left);
+ root -> right = inverted_left;
+ root -> left = inverted_right;
+ return root;
+}
diff --git a/out/production/leetcode_Contribution/c/23-Merge-K-Sorted-Lists.c b/out/production/leetcode_Contribution/c/23-Merge-K-Sorted-Lists.c
new file mode 100644
index 000000000..5379955d7
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/23-Merge-K-Sorted-Lists.c
@@ -0,0 +1,75 @@
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * struct ListNode *next;
+ * };
+ */
+
+/**
+ * Time: O(n.log(k))
+ * Space: O(1)
+ */
+
+typedef struct ListNode ListNode;
+
+ListNode* mergeLists(ListNode* l1, ListNode* l2)
+{
+ ListNode dummy;
+ dummy.next = NULL;
+ ListNode* tail = &dummy;
+
+ while(l1 && l2)
+ {
+ if(l1->val < l2->val)
+ {
+ tail->next = l1;
+ l1 = l1->next;
+ }
+ else
+ {
+ tail->next = l2;
+ l2 = l2->next;
+ }
+
+ tail = tail->next;
+ }
+
+ if(l1)
+ {
+ tail->next = l1;
+ }
+ else if(l2)
+ {
+ tail->next = l2;
+ }
+
+ return dummy.next;
+}
+
+struct ListNode* mergeKLists(struct ListNode** lists, int listsSize){
+
+ if(listsSize == 0)
+ {
+ return NULL;
+ }
+
+ while(listsSize > 1)
+ {
+ ListNode** mergedLists;
+ size_t mergedListsIndex = 0;
+
+ for(size_t i = 0; i < listsSize; i += 2)
+ {
+ ListNode* l1 = lists[i];
+ ListNode* l2 = (i + 1) < listsSize ? lists[i + 1] : NULL;
+
+ mergedLists[mergedListsIndex++] = mergeLists(l1, l2);
+ }
+
+ lists = mergedLists;
+ listsSize = (listsSize + 1) / 2;
+ }
+
+ return lists[0];
+}
diff --git a/out/production/leetcode_Contribution/c/230-Kth-Smallest-Element-In-BST.c b/out/production/leetcode_Contribution/c/230-Kth-Smallest-Element-In-BST.c
new file mode 100644
index 000000000..15f587a87
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/230-Kth-Smallest-Element-In-BST.c
@@ -0,0 +1,29 @@
+/*
+Given the root of a binary search tree, and an integer k, return
+the kth smallest value (1-indexed) of all the values of the nodes
+in the tree.
+
+Space: O(log(n)) (due to recursive calls)
+Time: O(n)
+*/
+
+void iterate_bst(struct TreeNode* t, int* pos, int* ans, int k) {
+ if (t==NULL)
+ return;
+ iterate_bst(t->left, pos, ans, k);
+ if ((*ans)!=-1) { // Already found
+ return;
+ } else if (*pos == k) { // t->val is the number wanted
+ *ans = t->val;
+ return;
+ }
+ *pos = *pos + 1;
+ iterate_bst(t->right, pos, ans, k);
+}
+
+int kthSmallest(struct TreeNode* root, int k){
+ int pos = 1; // Current pos in the tree
+ int ans = -1;
+ iterate_bst(root, &pos, &ans, k);
+ return ans;
+}
diff --git a/out/production/leetcode_Contribution/c/235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.c b/out/production/leetcode_Contribution/c/235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.c
new file mode 100644
index 000000000..5da9fb8ed
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.c
@@ -0,0 +1,23 @@
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+
+struct TreeNode* lowestCommonAncestor(struct TreeNode* root, struct TreeNode* p, struct TreeNode* q) {
+
+ int rootVal = root -> val;
+ int pVal = p -> val;
+ int qVal = q -> val;
+
+ if (pVal > rootVal && qVal > rootVal) {
+ return lowestCommonAncestor(root -> right, p, q);
+ } else if (pVal < rootVal && qVal < rootVal) {
+ return lowestCommonAncestor(root -> left, p, q);
+ }
+ return root;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/238-Product-of-Array-Except-Self.c b/out/production/leetcode_Contribution/c/238-Product-of-Array-Except-Self.c
new file mode 100644
index 000000000..ba642398e
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/238-Product-of-Array-Except-Self.c
@@ -0,0 +1,27 @@
+/*
+ Time: O(n)
+ Space: O(n)
+
+ * Note: The returned array must be malloced, assume caller calls free().
+*/
+
+int* productExceptSelf(int* nums, int numsSize, int* returnSize) {
+ *returnSize = numsSize;
+
+ int *result = (int *)malloc(sizeof(int)*numsSize);
+ memset(result, 1, numsSize*sizeof(result[0])); // Fill up result array with 1s
+
+ int pre = 1;
+ for(int i=0; i=0; i--) {
+ result[i] *= post;
+ post *= nums[i];
+ }
+
+ return result;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/242-Valid-Anagram.c b/out/production/leetcode_Contribution/c/242-Valid-Anagram.c
new file mode 100644
index 000000000..6f87c3e06
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/242-Valid-Anagram.c
@@ -0,0 +1,12 @@
+bool isAnagram(char* s, char* t) {
+ int hash[26] = {0};
+ int i = 0;
+
+ while (s[i]) hash[s[i++] - 'a']++;
+ i = 0;
+ while (t[i]) hash[t[i++] - 'a']--;
+
+ for (i = 0; i < 26; i++)
+ if (hash[i] != 0) return false;
+ return true;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/25-Reverse-Nodes-in-k-Group.c b/out/production/leetcode_Contribution/c/25-Reverse-Nodes-in-k-Group.c
new file mode 100644
index 000000000..6cbfa3613
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/25-Reverse-Nodes-in-k-Group.c
@@ -0,0 +1,60 @@
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * struct ListNode *next;
+ * };
+ */
+
+typedef struct ListNode ListNode;
+
+ListNode* getKth(ListNode* curr, int k)
+{
+ while(curr && k > 0)
+ {
+ curr = curr->next;
+ k--;
+ }
+
+ return curr;
+}
+
+struct ListNode* reverseKGroup(struct ListNode* head, int k){
+ ListNode dummy = { 0, head };
+ ListNode* prevGroupTail = &dummy;
+
+ while(true)
+ {
+ ListNode* kth = getKth(prevGroupTail, k);
+
+ if(!kth)
+ {
+ break;
+ }
+
+ ListNode* nextGroupHead = kth->next;
+
+
+ // Reverse group
+ ListNode* prev = nextGroupHead;
+ ListNode* curr = prevGroupTail->next;
+ while(curr != nextGroupHead)
+ {
+ ListNode* temp = curr->next;
+ curr->next = prev;
+ // Increment the pointers
+ prev = curr;
+ curr = temp;
+ }
+
+
+ ListNode* lastNodeInCurrentGroup = prevGroupTail->next;
+ // Connect the previous group to the current group
+ prevGroupTail->next = kth; // kth is now the first node in the group
+ // Update prevGroupTail for the next iteration of the loop
+ prevGroupTail = lastNodeInCurrentGroup;
+
+ }
+
+ return dummy.next;
+}
diff --git a/out/production/leetcode_Contribution/c/263-Ugly-Number.c b/out/production/leetcode_Contribution/c/263-Ugly-Number.c
new file mode 100644
index 000000000..61453593d
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/263-Ugly-Number.c
@@ -0,0 +1,18 @@
+/*
+An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.
+Given an integer n, return true if n is an ugly number.
+*/
+
+bool isUgly(int n){
+ if (n<=0)
+ return false;
+ if (n==1)
+ return true;
+ if (n%3==0)
+ return isUgly(n/3);
+ if (n%2==0)
+ return isUgly(n/2);
+ if (n%5==0)
+ return isUgly(n/5);
+ return false;
+}
diff --git a/out/production/leetcode_Contribution/c/268-Missing-Number.c b/out/production/leetcode_Contribution/c/268-Missing-Number.c
new file mode 100644
index 000000000..6f3ac6fc3
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/268-Missing-Number.c
@@ -0,0 +1,8 @@
+int missingNumber(int* nums, int numsSize){
+ int res = numsSize;
+
+ for (int i = 0; i < numsSize; i++) {
+ res += i - nums[i];
+ }
+ return res;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/27-Remove-Element.c b/out/production/leetcode_Contribution/c/27-Remove-Element.c
new file mode 100644
index 000000000..490383b21
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/27-Remove-Element.c
@@ -0,0 +1,14 @@
+int removeElement(int* nums, int numsSize, int val){
+ int k = 0;
+
+ for(int i = 0; i < numsSize; i++)
+ {
+ if(nums[i] != val)
+ {
+ nums[k] = nums[i];
+ k++;
+ }
+ }
+
+ return k;
+}
diff --git a/out/production/leetcode_Contribution/c/283-Move-Zeroes.c b/out/production/leetcode_Contribution/c/283-Move-Zeroes.c
new file mode 100644
index 000000000..0e2039579
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/283-Move-Zeroes.c
@@ -0,0 +1,12 @@
+void moveZeroes(int* nums, int numsSize){
+ int pos = 0;
+
+ for(int i=0; i= *dataSize) // (+10) to add a little bit of margin for any data to be written in this function scope
+ {
+ // Reallocate data string for a bigger space
+ *dataSize += DATA_ALLOCATION_SIZE;
+ *data = (char*)realloc(*data, *dataSize * sizeof(char));
+ }
+
+ if(!node)
+ {
+ (*data)[(*dataIndex)++] = 'N';
+ (*data)[(*dataIndex)++] = ',';
+ return;
+ }
+
+ // Returns total number of characters written is returned excluding the null-character
+ int charsWritten = sprintf(*data + *dataIndex, "%d", node->val);
+ *dataIndex += charsWritten;
+ (*data)[(*dataIndex)++] = ','; // This is actually is written in-place of the null terminator
+
+ dfs_encode(node->left, data, dataIndex, dataSize);
+ dfs_encode(node->right, data, dataIndex, dataSize);
+}
+
+TreeNode* dfs_decode(char** data)
+{
+ // Reached end of the string
+ if((*data)[0] == '\0')
+ {
+ return NULL;
+ }
+ else if((*data)[0] == 'N')
+ {
+ // Skip two chars ('N' and ',')
+ *data += 2;
+ return NULL;
+ }
+
+ TreeNode* node = (TreeNode*)malloc(sizeof(TreeNode));
+ char* endPtr = NULL; // Points to the first char after the numeric value
+
+ // Set the node value
+ node->val = strtol(*data, &endPtr, 10);
+ *data = endPtr + 1; // (+1) to skip the ','
+
+ node->left = dfs_decode(data);
+ node->right = dfs_decode(data);
+
+ return node;
+}
+
+/** Encodes a tree to a single string. */
+char* serialize(struct TreeNode* root) {
+ // Allocate the maximum possible number of nodes
+ int dataSize = DATA_ALLOCATION_SIZE;
+ char* data = (char*)malloc(dataSize * sizeof(char));
+ int dataIndex = 0; // points to the first empty space in the data string
+
+ dfs_encode(root, &data, &dataIndex, &dataSize);
+ // Add the null terminator
+ data[dataIndex] = '\0';
+
+ return data;
+}
+
+/** Decodes your encoded data to tree. */
+struct TreeNode* deserialize(char* data) {
+
+ return dfs_decode(&data);
+}
+
+// Your functions will be called as such:
+// char* data = serialize(root);
+// deserialize(data);
diff --git a/out/production/leetcode_Contribution/c/3-Longest-Substring-Without-Repeating-Characters.c b/out/production/leetcode_Contribution/c/3-Longest-Substring-Without-Repeating-Characters.c
new file mode 100644
index 000000000..0dd45d67f
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/3-Longest-Substring-Without-Repeating-Characters.c
@@ -0,0 +1,28 @@
+/*
+Given a string s, find the length of the longest substring without repeating characters.
+Time: O(n)
+Space: O(1)
+*/
+
+int max(int a, int b) {
+ return a>b?a:b;
+}
+
+int lengthOfLongestSubstring(char * s){
+ int alpha[128] = {0};
+ int i=0;
+ int j=0;
+ int ans=0;
+ while (s[j]!='\0') {
+ alpha[s[j]]++;
+ if (alpha[s[j]]>1) {
+ while (alpha[s[j]]>1) {
+ alpha[s[i]]--;
+ i++;
+ }
+ }
+ ans = max(ans, j-i+1);
+ j++;
+ }
+ return ans;
+}
diff --git a/out/production/leetcode_Contribution/c/300-Longest-Increasing-Subsequence.c b/out/production/leetcode_Contribution/c/300-Longest-Increasing-Subsequence.c
new file mode 100644
index 000000000..185f969ef
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/300-Longest-Increasing-Subsequence.c
@@ -0,0 +1,26 @@
+/*
+Given an integer array nums, return the length of the longest strictly increasing subsequence.
+Time: O(nlog(n))
+Space: O(n)
+*/
+
+int lengthOfLIS(int* nums, int numsSize){
+ int max=0, mid, i, j;
+ int* dp = calloc(numsSize, sizeof(int)); // dp[k] is the minimal last value of a subsequence of size k+1;
+ dp[0] = nums[0];
+ for (int k=0; k b) ? a : b;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/322-Coin-Change.c b/out/production/leetcode_Contribution/c/322-Coin-Change.c
new file mode 100644
index 000000000..c3a1ef107
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/322-Coin-Change.c
@@ -0,0 +1,28 @@
+/*
+Return the fewest number of coins that you need to make up that amount.
+Time; O(nm) where n is the amount desired and m the number of coins
+Space: O(n)
+*/
+
+int min(unsigned int a, int b) {
+ return a=coins[j] && cpt>dp[i-coins[j]])
+ cpt = dp[i-coins[j]];
+ }
+ if (cpt!=UINT_MAX)
+ dp[i] = cpt+1;
+ }
+ return dp[amount]==UINT_MAX?-1:dp[amount];
+}
diff --git a/out/production/leetcode_Contribution/c/329-Longest-Increasing-Path-in-a-Matrix.c b/out/production/leetcode_Contribution/c/329-Longest-Increasing-Path-in-a-Matrix.c
new file mode 100644
index 000000000..b6061179b
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/329-Longest-Increasing-Path-in-a-Matrix.c
@@ -0,0 +1,40 @@
+/*
+Given an m x n integers matrix, return the length of the longest increasing path in matrix.
+Time; O(n*m)
+Space; O(n*m)
+
+*/
+
+int max(int a, int b) {
+ return a>b?a:b;
+}
+
+int dfs(int** matrix, int** dp, int n, int m, int i, int j) {
+ if (dp[i][j]!=0)
+ return dp[i][j];
+ int cpt=0;
+ if (i>0 && matrix[i-1][j]>matrix[i][j])
+ cpt = max(cpt, dfs(matrix, dp, n, m, i-1, j));
+ if (j>0 && matrix[i][j-1]>matrix[i][j])
+ cpt = max(cpt, dfs(matrix, dp, n, m, i, j-1));
+ if (i<(n-1) && matrix[i+1][j]>matrix[i][j])
+ cpt = max(cpt, dfs(matrix, dp, n, m, i+1, j));
+ if (j<(m-1) && matrix[i][j+1]>matrix[i][j])
+ cpt = max(cpt, dfs(matrix, dp, n, m, i, j+1));
+ dp[i][j] = cpt+1;
+ return cpt+1;
+}
+
+int longestIncreasingPath(int** matrix, int matrixSize, int* matrixColSize){
+ int** dp = malloc(sizeof(int*)*matrixSize);
+ int m = *matrixColSize, i, j;
+ for (i=0; i nums[m+1]){
+ return m;
+ }
+ else if(s < m && nums[m] < nums[m-1]){
+ return m - 1;
+ }
+ else if(nums[s] < nums[m]){
+ s = m + 1;
+ }
+ else if(nums[s] >= nums[m]){
+ e = m - 1;
+ }
+ }
+
+ // If the array is not rotated then last position will be the pivot element.
+
+ return numsSize;
+}
+
+int binarySearch(int *nums, int s, int e, int target)
+{
+ while(s <= e){
+
+ int m = s + (e - s)/2;
+
+ if(nums[m] == target){
+ return m;
+ }
+ else if(nums[m] < target){
+ s = m + 1;
+ }
+ else{
+ e = m - 1;
+ }
+ }
+
+ return -1;
+}
+
+int search(int* nums, int numsSize, int target){
+
+ int n = numsSize - 1;
+
+ int pivotIndex = findPivotIndex(nums, n);
+
+ int firstTry = binarySearch(nums, 0, pivotIndex, target);
+
+ if(firstTry != -1){
+ return firstTry;
+ }
+
+ return binarySearch(nums, pivotIndex + 1, n, target);
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/338-Counting-Bits.c b/out/production/leetcode_Contribution/c/338-Counting-Bits.c
new file mode 100644
index 000000000..063c19fa4
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/338-Counting-Bits.c
@@ -0,0 +1,20 @@
+/**
+ * Note: The returned array must be malloced, assume caller calls free().
+ */
+int* countBits(int n, int* returnSize){
+ // Initialize array of size n + 1
+ int arraySize = n + 1;
+ *returnSize = arraySize;
+ int *dp = (int *)malloc(sizeof(int)*arraySize);
+ memset(dp, 0, arraySize*sizeof(dp[0]));
+ int offset = 1;
+
+ // Perform dp
+ for (int i = 1; i <= n; i++) {
+ if (offset * 2 == i) {
+ offset = i;
+ }
+ dp[i] = 1 + dp[i - offset];
+ }
+ return dp;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/344-Reverse-String.c b/out/production/leetcode_Contribution/c/344-Reverse-String.c
new file mode 100644
index 000000000..07fac3788
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/344-Reverse-String.c
@@ -0,0 +1,15 @@
+/*
+Write a function that reverses a string. The input string is given as an array of characters s.
+
+Space: O(1)
+Time: O(n)
+*/
+
+void reverseString(char* s, int sSize){
+ int h = sSize/2;
+ for (int i=0; i y) ? (x) : (y))
+
+double findMedianSortedArrays(int* nums1, int nums1Size, int* nums2, int nums2Size){
+ int* A = nums1;
+ int* B = nums2;
+ int ASize = nums1Size;
+ int BSize = nums2Size;
+
+ int total = nums1Size + nums2Size;
+ int half = total / 2;
+
+ if(nums2Size < nums1Size)
+ {
+ A = nums2;
+ B = nums1;
+ ASize = nums2Size;
+ BSize = nums1Size;
+ }
+
+ int l = 0;
+ int r = ASize - 1;
+
+ while(true)
+ {
+ int i = l + ((r - l - 2 + 1) / 2); // A Mid, round down instead of rounding towards 0
+ int j = half - i - 2; // B Mid
+
+
+ int Aleft = i >= 0 ? A[i] : INT_MIN;
+ int Aright = (i + 1) < ASize ? A[i + 1] : INT_MAX;
+ int Bleft = j >= 0 ? B[j] : INT_MIN;
+ int Bright = (j + 1) < BSize ? B[j + 1] : INT_MAX;
+
+ // partition is correct
+ if(Aleft <= Bright && Bleft <= Aright)
+ {
+ // Odd
+ if(total % 2)
+ {
+ return min(Aright, Bright);
+ }
+
+ // Even
+ return (max(Aleft, Bleft) + min(Aright, Bright)) / 2.0;
+ }
+ else if(Aleft > Bright)
+ {
+ r = i - 1;
+ }
+ else
+ {
+ l = i + 1;
+ }
+ }
+
+}
diff --git a/out/production/leetcode_Contribution/c/417-Pacific-Atlantic-Waterflow.c b/out/production/leetcode_Contribution/c/417-Pacific-Atlantic-Waterflow.c
new file mode 100644
index 000000000..826266b6e
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/417-Pacific-Atlantic-Waterflow.c
@@ -0,0 +1,83 @@
+
+
+/**
+ * Return an array of arrays of size *returnSize.
+ * The sizes of the arrays are returned as *returnColumnSizes array.
+ * Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().
+ */
+
+int directions[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
+bool pacific_reach[200][200];
+bool atlantic_reach[200][200];
+
+void resetSet(bool set[200][200]) {
+ for (int i = 0; i < 200; i++) {
+ for (int j = 0; j < 200; j++) {
+ set[i][j] = false;
+ }
+ }
+}
+
+void dfs(int row, int col, bool set[200][200], int** heights, int rows, int cols) {
+ set[row][col] = true;
+ int a = 0;
+ int b = 0;
+ for (int i = 0; i < 4; i++) {
+ a = directions[i][0] + row;
+ b = directions[i][1] + col;
+ if ((a >= 0) && (a < rows) && (b >= 0) && (b < cols) && (!set[a][b])) {
+ if (heights[a][b] >= heights[row][col]) {
+ dfs(a, b, set, heights, rows, cols);
+ }
+ }
+ }
+}
+
+int** pacificAtlantic(int** heights, int heightsSize, int* heightsColSize, int* returnSize, int** returnColumnSizes) {
+
+ int rows = heightsSize;
+ int cols = heightsColSize[0];
+
+ resetSet(pacific_reach);
+ resetSet(atlantic_reach);
+
+ for (int row = 0; row < rows; row++) {
+ dfs(row, 0, pacific_reach, heights, rows, cols);
+ dfs(row, cols - 1, atlantic_reach, heights, rows, cols);
+ }
+ for (int col = 0; col < cols; col++) {
+ dfs(0, col, pacific_reach, heights, rows, cols);
+ dfs(rows - 1, col, atlantic_reach, heights, rows, cols);
+ }
+
+ int res = 0;
+ for (int row = 0; row < rows; row++) {
+ for (int col = 0; col < cols; col++) {
+ if ((pacific_reach[row][col] == true) && (atlantic_reach[row][col] == true)) {
+ res += 1;
+ }
+ }
+ }
+
+ *returnSize = res;
+ returnColumnSizes[0] = (int*)malloc(res * sizeof(int));
+ for (int i = 0; i < res; i++) {
+ returnColumnSizes[0][i] = 2;
+ }
+
+ int** results = (int**)malloc(res * sizeof(int*));
+ res = 0;
+ for (int row = 0; row < rows; row++) {
+ for (int col = 0; col < cols; col++) {
+ if ((pacific_reach[row][col] == true) && (atlantic_reach[row][col] == true)) {
+ int* buffer = (int*)malloc(2 * sizeof(int));
+ buffer[0] = row;
+ buffer[1] = col;
+ results[res] = buffer;
+ res += 1;
+ }
+ }
+ }
+
+ return results;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/42-Trapping-Rain-Water.c b/out/production/leetcode_Contribution/c/42-Trapping-Rain-Water.c
new file mode 100644
index 000000000..e86497142
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/42-Trapping-Rain-Water.c
@@ -0,0 +1,44 @@
+/*
+ Given elevation map array, compute trapped water
+ Ex. height = [0,1,0,2,1,0,1,3,2,1,2,1] -> 6
+
+ Keep two arrays which store the largest bar uptil that point in both
+ forward (0 -> n) and reverse (n -> 0) directions. Maximum trappable water
+ depends on the smaller of the left and right maximums.
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+int trap(int* height, int heightSize) {
+
+ // Initialize leftMax to store the largest height present to the left of every bar
+ int leftMax[heightSize];
+
+ leftMax[0] = height[0];
+ for (int i = 1; i < heightSize; ++i) {
+ leftMax[i] = fmax(height[i], leftMax[i-1]);
+ }
+
+ // Initialize rightMax similar to leftMax but for largest height to the right
+ int rightMax[heightSize];
+
+ rightMax[heightSize-1] = height[heightSize-1];
+ for (int i = heightSize-2; i >= 0; --i) {
+ rightMax[i] = fmax(height[i], rightMax[i+1]);
+ }
+
+ int waterTrapped = 0;
+
+ for (int i = 0; i < heightSize; ++i) {
+ // The minimum of both side decides how much water can be trapped
+ int minHeight = fmin(leftMax[i], rightMax[i]);
+
+ // If the minHeight is more the current height at a point, water is present there
+ if (minHeight > height[i]) {
+ waterTrapped += minHeight - height[i];
+ }
+ }
+
+ return waterTrapped;
+}
diff --git a/out/production/leetcode_Contribution/c/424-Longest-Repeating-Character-Replacement.c b/out/production/leetcode_Contribution/c/424-Longest-Repeating-Character-Replacement.c
new file mode 100644
index 000000000..5b6ea100b
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/424-Longest-Repeating-Character-Replacement.c
@@ -0,0 +1,20 @@
+int characterReplacement(char * s, int k){
+ int count[26] = {0};
+ int left = 0, right = 0, maxCount = 0;
+
+ while (right < strlen(s)) {
+ count[s[right] - 'A']++;
+ maxCount = max(maxCount, count[s[right] - 'A']);
+ right++;
+ if (right - left - maxCount > k) {
+ count[s[left] - 'A']--;
+ left++;
+ }
+ }
+ return right - left;
+}
+
+// C doesn't have a built-in max function
+int max(int a, int b) {
+ return (a > b) ? a : b;
+}
diff --git a/out/production/leetcode_Contribution/c/45-Jump-Game-II.c b/out/production/leetcode_Contribution/c/45-Jump-Game-II.c
new file mode 100644
index 000000000..39ef3ff51
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/45-Jump-Game-II.c
@@ -0,0 +1,21 @@
+int jump(int* nums, int numsSize){
+ int left = 0;
+ int right = 0;
+ int res = 0;
+
+ while (right < numsSize - 1) {
+ int maxJump = 0;
+ for (int i = left; i <= right; i++) {
+ maxJump = max(maxJump, i + nums[i]);
+ }
+ left = right + 1;
+ right = maxJump;
+ res += 1;
+ }
+ return res;
+}
+
+// C doesn't have a built-in max function
+int max(int a, int b) {
+ return (a > b) ? a : b;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/463-Island-Perimeter.c b/out/production/leetcode_Contribution/c/463-Island-Perimeter.c
new file mode 100644
index 000000000..f2ac70de4
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/463-Island-Perimeter.c
@@ -0,0 +1,23 @@
+/*
+Determine the perimeter of the island.
+
+Space: O(1)
+Time: O(n²)
+*/
+
+
+int islandPerimeter(int** grid, int gridSize, int* gridColSize){
+ int stripes = 0;
+ for (int i=0; i0 && grid[i-1][j]==1) // Common stripe at the top
+ stripes -= 2;
+ if (j>0 && grid[i][j-1]==1) // Common stripe on the left
+ stripes -= 2;
+ }
+ }
+ }
+ return stripes;
+}
diff --git a/out/production/leetcode_Contribution/c/48-Rotate-Image.c b/out/production/leetcode_Contribution/c/48-Rotate-Image.c
new file mode 100644
index 000000000..34067590c
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/48-Rotate-Image.c
@@ -0,0 +1,28 @@
+void rotate(int** matrix, int matrixSize, int* matrixColSize){
+ int left = 0;
+ int right = matrixSize - 1;
+
+ while (left < right) {
+ for (int i = 0; i < right - left; i++) {
+ int top = left;
+ int bottom = right;
+
+ // save the topLeft
+ int topLeft = matrix[top][left + i];
+
+ // move bottom left into top left
+ matrix[top][left + i] = matrix[bottom - i][left];
+
+ // move bottom right into bottom left
+ matrix[bottom - i][left] = matrix[bottom][right - i];
+
+ // move top right into bottom right
+ matrix[bottom][right - i] = matrix[top + i][right];
+
+ // move top left into top right
+ matrix[top + i][right] = topLeft;
+ }
+ right -= 1;
+ left += 1;
+ }
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/5-Longest-Palindromic-Substring.c b/out/production/leetcode_Contribution/c/5-Longest-Palindromic-Substring.c
new file mode 100644
index 000000000..884f9dc26
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/5-Longest-Palindromic-Substring.c
@@ -0,0 +1,42 @@
+
+/*
+Given a string s, return the longest palindromic substring in s.
+Time: O(n^2)
+Space: O(1)
+*/
+
+char* longestPalindrome(char * s){
+ int pos=0;
+ int lenmax=1;
+ for (int i=0; s[i]!='\0'; i++){
+ int g=i, d=i;
+ while (g>=0 && s[d]!='\0' && s[g]==s[d]){
+ g-=1;
+ d+=1;
+ }
+ d--;
+ g++;
+ if (d-g>=lenmax){
+ lenmax=d-g+1;
+ pos=g;
+ }
+ g=i,d=i+1;
+ while (g>=0 && s[d]!='\0' && s[g]==s[d]){
+ g-=1;
+ d+=1;
+ }
+ d--;
+ g++;
+
+ if (d-g>=lenmax){
+ lenmax=d-g+1;
+ pos=g;
+ }
+ }
+ char* new_s = (char*)malloc(sizeof(char)*(lenmax+1));
+ new_s[lenmax]='\0';
+ for (int i=0; i= 0)
+ return res;
+ else
+ return 1.0 / res;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/518-Coin-Change-II.c b/out/production/leetcode_Contribution/c/518-Coin-Change-II.c
new file mode 100644
index 000000000..dbbff57e0
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/518-Coin-Change-II.c
@@ -0,0 +1,24 @@
+/*
+You are given an integer array coins representing coins of different
+denominations and an integer amount representing a total amount of money.
+Return the number of combinations that make up that amount.
+
+Space: O(n) where n is the amount
+Time: O(np) where p is the number of coins
+*/
+
+int change(int amount, int* coins, int coinsSize){
+ if (coinsSize==0) { // Take care of extreme cases
+ return amount==0;
+ }
+ int* dp = calloc((amount+1), sizeof(int));
+ dp[0] = 1; // One way to give zero
+ for (int i=0; i=0; k--)
+ if (board[k][j])
+ return false;
+ for (int k=j-1; k>=0; k--)
+ if (board[i][k])
+ return false;
+ int m = min(i, j)+1;
+ for (int k=1; k b) ? a : b;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/543-Diameter-Of-Binary-Tree.c b/out/production/leetcode_Contribution/c/543-Diameter-Of-Binary-Tree.c
new file mode 100644
index 000000000..da5acc352
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/543-Diameter-Of-Binary-Tree.c
@@ -0,0 +1,33 @@
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+
+int max(int a, int b) {
+ if (a > b) {
+ return a;
+ }
+ return b;
+}
+
+int recur(struct TreeNode* root, int* maxDiameter) {
+ if (root == NULL) {
+ return 0;
+ }
+ int leftHeight = recur(root -> left, maxDiameter);
+ int rightHeight = recur(root -> right, maxDiameter);
+ *maxDiameter = max(*maxDiameter, leftHeight + rightHeight);
+ return max(leftHeight, rightHeight) + 1;
+}
+
+int diameterOfBinaryTree(struct TreeNode* root) {
+ int maxDiameter = 0;
+
+ recur(root, &maxDiameter);
+
+ return maxDiameter;
+}
diff --git a/out/production/leetcode_Contribution/c/55-Jump-Game.c b/out/production/leetcode_Contribution/c/55-Jump-Game.c
new file mode 100644
index 000000000..327b87967
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/55-Jump-Game.c
@@ -0,0 +1,10 @@
+bool canJump(int* nums, int numsSize){
+ int goal = numsSize - 1;
+
+ for (int i = numsSize - 2; i >= 0; i--) {
+ if (i + nums[i] >= goal) {
+ goal = i;
+ }
+ }
+ return goal == 0;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/567-Permutation-in-String.c b/out/production/leetcode_Contribution/c/567-Permutation-in-String.c
new file mode 100644
index 000000000..62362caf5
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/567-Permutation-in-String.c
@@ -0,0 +1,36 @@
+bool isPermutation(int *count) {
+ for (int i = 0; i < 26; i++) {
+ if (count[i] != 0) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool checkInclusion(char * s1, char * s2){
+ const int m = strlen(s1);
+ const int n = strlen(s2);
+
+ if (m > n) {
+ return false;
+ }
+
+ int count[26] = {0};
+ for (int i = 0; i < m; i++) {
+ count[s1[i] - 'a']++;
+ count[s2[i] - 'a']--;
+ }
+
+ if (isPermutation(count)) {
+ return true;
+ }
+
+ for (int i = m; i < n; i++) {
+ count[s2[i] - 'a']--;
+ count[s2[i - m] - 'a']++;
+ if (isPermutation(count)) {
+ return true;
+ }
+ }
+ return false;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/572-Subtree-Of-Another-Tree.c b/out/production/leetcode_Contribution/c/572-Subtree-Of-Another-Tree.c
new file mode 100644
index 000000000..14767f1d1
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/572-Subtree-Of-Another-Tree.c
@@ -0,0 +1,34 @@
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * struct TreeNode *left;
+ * struct TreeNode *right;
+ * };
+ */
+
+bool isSame(struct TreeNode* p, struct TreeNode* q) {
+
+ if (p == NULL && q == NULL) {
+ return true;
+ }
+ if ((p == NULL || q == NULL) || (p -> val != q -> val)) {
+ return false;
+ }
+ return (isSame(p -> left, q -> left) && isSame(p -> right, q -> right));
+}
+
+
+bool isSubtree(struct TreeNode* root, struct TreeNode* subRoot){
+
+ if (root == NULL) {
+ return false;
+ }
+
+ bool compareTree = false;
+ if (root -> val == subRoot -> val) {
+ compareTree = isSame(root, subRoot);
+ }
+ return (isSubtree(root -> left, subRoot) || isSubtree(root -> right, subRoot) || compareTree);
+}
diff --git a/out/production/leetcode_Contribution/c/58-Length-Of-Last-Word.c b/out/production/leetcode_Contribution/c/58-Length-Of-Last-Word.c
new file mode 100644
index 000000000..740d8a2a4
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/58-Length-Of-Last-Word.c
@@ -0,0 +1,13 @@
+int lengthOfLastWord(char * s){
+ int len = 0;
+
+ if(s[0] != ' ') len = 1;
+
+ for(int i=1; i=n;
+}
diff --git a/out/production/leetcode_Contribution/c/617-Merge-Two-Binary-Trees.c b/out/production/leetcode_Contribution/c/617-Merge-Two-Binary-Trees.c
new file mode 100644
index 000000000..fc3bedb3a
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/617-Merge-Two-Binary-Trees.c
@@ -0,0 +1,18 @@
+/*
+You are given two binary trees root1 and root2.
+Return the merged tree
+
+Time: O(n)
+Space: O(1) As we reuse the trees
+*/
+
+struct TreeNode* mergeTrees(struct TreeNode* root1, struct TreeNode* root2){
+ if (root1==NULL)
+ return root2;
+ else if (root2==NULL)
+ return root1;
+ root1->val += root2->val;
+ root1->left = mergeTrees(root1->left, root2->left);
+ root1->right = mergeTrees(root1->right, root2->right);
+ return root1;
+}
diff --git a/out/production/leetcode_Contribution/c/62-Unique-Paths.c b/out/production/leetcode_Contribution/c/62-Unique-Paths.c
new file mode 100644
index 000000000..a72320b61
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/62-Unique-Paths.c
@@ -0,0 +1,30 @@
+int dp[105][105] = {};
+
+int ways(int posX, int posY, int m, int n)
+{
+ if(posX == m-1 && posY == n-1) return 1;
+
+ if(posX >= m || posY >= n) return 0;
+
+ if(dp[posX][posY] != -1) return dp[posX][posY];
+
+ int right = ways(posX + 1, posY, m, n); // moves to right corner.
+
+ int bottom = ways(posX, posY + 1, m, n);// moves to bottom corner.
+
+ dp[posX][posY] = right + bottom;
+
+ return dp[posX][posY];
+}
+
+int uniquePaths(int m, int n) {
+
+ // Initializing the dp array with -1 value.
+ for(int i = 0; i < 105; i++){
+ for(int j = 0; j < 105; j++) dp[i][j] = -1;
+ }
+
+ int ans = ways(0, 0, m, n);
+
+ return ans;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/647-Palindromic-Substrings.c b/out/production/leetcode_Contribution/c/647-Palindromic-Substrings.c
new file mode 100644
index 000000000..502bc83a6
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/647-Palindromic-Substrings.c
@@ -0,0 +1,31 @@
+/*
+Given a string s, return the number of palindromic substrings in it.
+A string is a palindrome when it reads the same backward as forward.
+A substring is a contiguous sequence of characters within the string.
+Time: O(n^2)
+Space: O(1)
+*/
+
+int countSubstrings(char * s){
+ int cpt=0;
+ int x,y;
+
+ for (int i=0; s[i]!='\0'; i++){
+ cpt++; // s[i] is a palindrom
+ x=i-1;
+ y=i+1;
+ while (x>=0 && s[y]!='\0' && s[x]==s[y]){ // Odd length palindromic substring
+ cpt++;
+ x--;
+ y++;
+ }
+ x=i;
+ y=i+1;
+ while (x>=0 && s[y]!='\0' && s[x]==s[y]){ // Even length palindromic substring
+ cpt++;
+ x--;
+ y++;
+ }
+ }
+ return cpt;
+}
diff --git a/out/production/leetcode_Contribution/c/66-Plus-One.c b/out/production/leetcode_Contribution/c/66-Plus-One.c
new file mode 100644
index 000000000..2f32b2269
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/66-Plus-One.c
@@ -0,0 +1,44 @@
+/*
+ Given an integer array where the elements represent the digits of a number,
+ return the resulting array when we add one to it.
+ Ex. digits = [1,2,3] + 1 -> [1,2,4]
+
+ The length of the array after adding 1 will either remain the same or
+ increase by 1. So we keep the size of the result array as n+1 during the
+ start. We iterate from the last digit to the first digit backwards and
+ keep track of the carry generated by the previous digit.
+
+ If there is a carry left at the end, the addition caused the length to
+ increase, so we return the result. Else if there is no carry, the length
+ remained constant, so we skip the first element of result and return.
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Note: The returned array must be malloced, assume caller calls free().
+ */
+int* plusOne(int* digits, int digitsSize, int* returnSize){
+
+ // Reserve the result with a digitsSize+1 size array
+ int* result = (int*) malloc(sizeof(int)*(digitsSize+1));
+ *returnSize = digitsSize+1;
+ result[0] = 1;
+
+ int carry = 1;
+ for (int i = digitsSize; i > 0; --i) {
+ int sum = digits[i-1] + carry;
+ carry = sum/10;
+ sum = sum%10;
+
+ result[i] = sum;
+ }
+
+ if (carry)
+ return result;
+
+ // Skip the additional element which was reserved for carry
+ *returnSize = digitsSize;
+ return result+1;
+}
diff --git a/out/production/leetcode_Contribution/c/678-Valid-Parenthesis-String.c b/out/production/leetcode_Contribution/c/678-Valid-Parenthesis-String.c
new file mode 100644
index 000000000..e10516751
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/678-Valid-Parenthesis-String.c
@@ -0,0 +1,35 @@
+/*
+ Time: O(n)
+ Space: O(1)
+*/
+
+bool checkValidString(char * s) {
+ int n = strlen(s);
+
+ int balanced = 0;
+ for (int i=0; i=0; i--) {
+ if (s[i] == ')' || s[i] == '*')
+ balanced++;
+ else
+ balanced--;
+
+ if (balanced < 0)
+ return false;
+ }
+
+ return true;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/682-Baseball-Game.c b/out/production/leetcode_Contribution/c/682-Baseball-Game.c
new file mode 100644
index 000000000..567bea7c4
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/682-Baseball-Game.c
@@ -0,0 +1,71 @@
+/*
+Return the sum of all the scores on the record after applying all the operations.
+
+Space: O(n)
+Time: O(n)
+Where n is the size of operations
+*/
+
+//-------Implementation of a stack--------
+
+typedef struct stack {
+ int val;
+ struct stack* next;
+} stack;
+
+int sum(stack* s) {
+ if (s==NULL)
+ return 0;
+ return s->val + sum(s->next);
+}
+
+stack* add(stack* s, int value) {
+ stack* new_s = malloc(sizeof(stack));
+ new_s->val = value;
+ new_s->next = s;
+ return new_s;
+}
+
+stack* rmv(stack* s) {
+ if (s==NULL) {
+ printf("Impossible de supprimer un élément d'une pile vide");
+ return NULL;
+ }
+ stack* ans = s->next;
+ free(s);
+ return ans;
+}
+
+//------------Main algorithm-------------
+
+int calPoints(char ** operations, int operationsSize){
+ stack* s = NULL;
+ for (int i=0; ival + (s->next)->val;
+ s = add(s, to_add);
+ } else if (operations[i][0]=='D') {
+ s = add(s, 2*(s->val));
+ } else if (operations[i][0]=='C') {
+ s = rmv(s);
+ } else { // It's a number
+ if (operations[i][0]=='-') { // It's a negative number
+ int n = 0;
+ for (int j=0; operations[i][j+1]!='\0'; j++) {
+ n *= 10;
+ n -= operations[i][j+1] - '0';
+ }
+ s = add(s, n);
+ } else { // It's a positive number
+ int n = 0;
+ for (int j=0; operations[i][j]!='\0'; j++) {
+ n *= 10;
+ n += operations[i][j] - '0';
+ }
+ s = add(s, n);
+ }
+ }
+ }
+
+ return sum(s);
+}
diff --git a/out/production/leetcode_Contribution/c/684-Redundant-Connection.c b/out/production/leetcode_Contribution/c/684-Redundant-Connection.c
new file mode 100644
index 000000000..4ee3fb558
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/684-Redundant-Connection.c
@@ -0,0 +1,35 @@
+/*
+Return an edge that can be removed so that the resulting graph is a tree of n nodes.
+Time: O(n)
+Space: O(n)
+*/
+int max(int a, int b) {
+ return a>b?a:b;
+}
+
+int find(int* parent, int k) {
+ if (parent[k]==k)
+ return k;
+ return find(parent, parent[k]);
+}
+
+
+
+int* findRedundantConnection(int** edges, int edgesSize, int* edgesColSize, int* returnSize){
+ int* ans = malloc(sizeof(int)*2);
+ int* parent = malloc(sizeof(int)*(edgesSize+1));
+ for (int i=0; i<=edgesSize; i++)
+ parent[i] = i;
+ for (int i=0; ib?a:b;
+}
+
+int dfs(int** grid, int n, int m, int i, int j) {
+ int cpt=1;
+ grid[i][j]=0;
+ if (i>0 && grid[i-1][j]==1)
+ cpt += dfs(grid, n, m, i-1, j);
+ if (j>0 && grid[i][j-1]==1)
+ cpt += dfs(grid, n, m, i, j-1);
+ if (i<(n-1) && grid[i+1][j]==1)
+ cpt += dfs(grid, n, m, i+1, j);
+ if (j<(m-1) && grid[i][j+1]==1)
+ cpt += dfs(grid, n, m, i, j+1);
+ return cpt;
+}
+
+int maxAreaOfIsland(int** grid, int gridSize, int* gridColSize){
+ int m = 0, h=*gridColSize, i, j;
+ for (i=0; i INT_MAX)
+ return 0;
+
+ return reversed_num;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/70-Climbing-Stairs.c b/out/production/leetcode_Contribution/c/70-Climbing-Stairs.c
new file mode 100644
index 000000000..dd37d2dad
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/70-Climbing-Stairs.c
@@ -0,0 +1,15 @@
+int climbStairs(int n){
+ if (n <= 3) {
+ return n;
+ }
+
+ int n1 = 2;
+ int n2 = 3;
+
+ for (int i = 4; i <= n; i++) {
+ int temp = n1 + n2;
+ n1 = n2;
+ n2 = temp;
+ }
+ return n2;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/703-Kth-Largest-Element-In-A-Stream.c b/out/production/leetcode_Contribution/c/703-Kth-Largest-Element-In-A-Stream.c
new file mode 100644
index 000000000..b9710e96b
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/703-Kth-Largest-Element-In-A-Stream.c
@@ -0,0 +1,145 @@
+
+struct heap {
+ int* array;
+ int len;
+ int max_len;
+ bool (*append)(struct heap* self, int val);
+ int (*pop)(struct heap* self);
+};
+
+bool heap_insert(struct heap*, int);
+int heap_pop(struct heap*);
+
+struct heap* Heap(int max_len) {
+ int* array = (int *)malloc(max_len * sizeof(int));
+ struct heap* heap = (struct heap*)malloc(sizeof(struct heap));
+ heap -> array = array;
+ heap -> max_len = max_len;
+ heap -> len = 0;
+ heap -> append = heap_insert;
+ heap -> pop = heap_pop;
+ return heap;
+}
+
+int heap_parent(int index) {
+ return (index - 1) / 2;
+}
+
+int heap_left(int index) {
+ return 2 * index + 1;
+}
+
+int heap_right(int index) {
+ return 2 * index + 2;
+}
+
+void heap_swap(struct heap* heap, int parent, int index) {
+ int temp = heap -> array[index];
+ heap -> array[index] = heap -> array[parent];
+ heap -> array[parent] = temp;
+}
+
+void heap_heapify(struct heap* heap, int index) {
+ if (index != 0) {
+ int parent = heap_parent(index);
+ if (heap -> array[parent] > heap -> array[index]) {
+ heap_swap(heap, parent, index);
+ heap_heapify(heap, parent);
+ }
+ }
+}
+
+bool heap_insert(struct heap* heap, int val) {
+
+ if (heap -> len == heap -> max_len) {
+ return false;
+ }
+ heap -> array[heap -> len] = val;
+ heap_heapify(heap, heap -> len);
+ heap -> len += 1;
+ return true;
+}
+
+bool heap_has_left(struct heap* heap,int index) {
+ return heap_left(index) < heap -> len;
+}
+
+bool heap_has_right(struct heap* heap, int index) {
+ return heap_right(index) < heap -> len;
+}
+
+void heap_heapify_reverse(struct heap* heap, int index) {
+
+ int left = heap_left(index);
+ int right = heap_right(index);
+ int minimum = index;
+ if (heap_has_left(heap, index) && (heap -> array[left] < heap -> array[minimum])) {
+ minimum = left;
+ }
+ if (heap_has_right(heap, index) && (heap -> array[right] < heap -> array[minimum])) {
+ minimum = right;
+ }
+ if (minimum != index) {
+ heap_swap(heap, index, minimum);
+ heap_heapify_reverse(heap, minimum);
+ }
+}
+
+int heap_pop(struct heap* heap) {
+ if (heap -> len == 0) {
+ return NULL;
+ }
+ int val = heap -> array[0];
+ heap -> len -= 1;
+ heap -> array[0] = heap -> array[heap -> len];
+ if (heap -> len > 1) {
+ heap_heapify_reverse(heap, 0);
+ }
+ return val;
+}
+
+void heap_free(struct heap* heap) {
+ free(heap -> array);
+ free(heap);
+}
+
+typedef struct {
+ struct heap* heap;
+ int k;
+} KthLargest;
+
+
+KthLargest* kthLargestCreate(int k, int* nums, int numsSize) {
+
+ KthLargest* self = malloc(sizeof(KthLargest));
+ self -> heap = Heap(numsSize + 2);
+ self -> k = k;
+ for (int i = 0; i < numsSize; i++) {
+ self -> heap -> append(self -> heap, nums[i]);
+ }
+ while (self -> heap -> len > k) {
+ self -> heap -> pop(self -> heap);
+ }
+ return self;
+}
+
+int kthLargestAdd(KthLargest* obj, int val) {
+ obj -> heap -> append(obj -> heap, val);
+ if (obj -> heap -> len > obj -> k) {
+ obj -> heap -> pop(obj -> heap);
+ }
+ return obj -> heap -> array[0];
+}
+
+void kthLargestFree(KthLargest* obj) {
+ heap_free(obj -> heap);
+ free(obj);
+}
+
+/**
+ * Your KthLargest struct will be instantiated and called as such:
+ * KthLargest* obj = kthLargestCreate(k, nums, numsSize);
+ * int param_1 = kthLargestAdd(obj, val);
+
+ * kthLargestFree(obj);
+*/
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/704-Binary-Search.c b/out/production/leetcode_Contribution/c/704-Binary-Search.c
new file mode 100644
index 000000000..e09c86992
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/704-Binary-Search.c
@@ -0,0 +1,30 @@
+/*
+ Given an array of integers, search for a target value.
+ Examples:
+ nums = [-1,0,3,5,9,12], target = 9, return 4 (index of target 9)
+ nums = [-1,0,3,5,9,12], target = 2, return -1 (not found)
+ Array is sorted, so perform binary search
+
+ Time: O(log n)
+ Space: O(1)
+*/
+
+int search(int* nums, int numsSize, int target) {
+ int left = 0;
+ int right = numsSize-1;
+
+ while (left <= right) {
+ int mid = left + (right - left) / 2;
+
+ if (nums[mid] == target) {
+ return mid;
+ }
+ else if (nums[mid] < target) {
+ left = mid + 1;
+ }
+ else {
+ right = mid - 1;
+ }
+ }
+ return -1;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/724-Find-Pivot-Index.c b/out/production/leetcode_Contribution/c/724-Find-Pivot-Index.c
new file mode 100644
index 000000000..0a82e5f08
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/724-Find-Pivot-Index.c
@@ -0,0 +1,22 @@
+/*
+Given an array of integers nums, calculate the pivot index of this array.
+
+Space: O(1)
+Time: O(n)
+*/
+
+int pivotIndex(int* nums, int numsSize){
+ int right_sum = 0;
+ int left_sum = 0;
+ for (int i=0; i< numsSize; i++) // Initialise the right sum
+ right_sum += nums[i];
+
+ for (int i=0; i [ 0, 0, 0],
+ [ 1, 1, 1]] [ 1, 0, 1]]
+
+ An identical result matrix can be initialised and then updated according to
+ the zeros values in the original matrix. However, this would take O(m*n)
+ space, which can be improved.
+
+ By doing the updations in the same matrix, space complexity becomes O(1). We
+ reserve the top most row as marker, they will signify whether the
+ corresponding column has a zero or not. Similarly the first column, will do
+ the same for the rows.
+
+ An additional variable is needed as the m[0][0] is common in both the first
+ row and first column.
+
+ Time: O(m*n) where m, n are the matrix dimensions
+ Space: O(1)
+*/
+
+void setZeroes(int** matrix, int matrixSize, int* matrixColSize){
+ int ROW = matrixSize;
+ int COL = *matrixColSize;
+ bool rowZero = false;
+
+ for (int r = 0; r < ROW; ++r) {
+ for (int c = 0; c < COL; ++c) {
+ if (matrix[r][c] == 0) {
+ matrix[0][c] = 0;
+ if (r > 0)
+ matrix[r][0] = 0;
+ else
+ rowZero = true;
+ }
+ }
+ }
+
+ for (int r = 1; r < ROW; ++r) {
+ for (int c = 1; c < COL; ++c) {
+ if (matrix[0][c] == 0 || matrix[r][0] == 0)
+ matrix[r][c] = 0;
+ }
+ }
+
+ // Set first column as zeros if matrix[0][0] is set
+ if (matrix[0][0] == 0) {
+ for (int r = 0; r < ROW; ++r) {
+ matrix[r][0] = 0;
+ }
+ }
+
+ // Set first row as zeros if rowZero is true
+ if (rowZero) {
+ for (int c = 0; c < COL; ++c) {
+ matrix[0][c] = 0;
+ }
+ }
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/739-Daily-Temperatures.c b/out/production/leetcode_Contribution/c/739-Daily-Temperatures.c
new file mode 100644
index 000000000..7f7c8c9a6
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/739-Daily-Temperatures.c
@@ -0,0 +1,39 @@
+/*
+ Given an array of temperatures, find the number of days after which the
+ temperature becomes more than temperature of that day.
+
+ Ex. temperatures = [73,74,75,71,69,72,76,73] -> [1,1,4,2,1,1,0,0]
+
+ Time: O(N)
+ Space: O(1)
+*/
+
+/**
+ * Note: The returned array must be malloced, assume caller calls free().
+ */
+int* dailyTemperatures(int* temperatures, int temperaturesSize, int* returnSize){
+ *returnSize = temperaturesSize;
+
+ int* result = (int*) malloc(sizeof(int)*temperaturesSize);
+
+ // Initialize result array to zero
+ for (int i = 0; i < temperaturesSize; ++i) result[i] = 0;
+
+
+ for (int i = temperaturesSize-1; i >= 0; --i) {
+ int j = i + 1;
+
+ while (j < temperaturesSize && temperatures[j] <= temperatures[i]) {
+ if (result[j] <= 0)
+ break;
+ j += result[j];
+ }
+
+ // If a day with higher temperature found, update result for that index
+ if (j < temperaturesSize && temperatures[j] > temperatures[i]) {
+ result[i] = j - i;
+ }
+ }
+
+ return result;
+}
diff --git a/out/production/leetcode_Contribution/c/74-Search-A-2D-Matrix.c b/out/production/leetcode_Contribution/c/74-Search-A-2D-Matrix.c
new file mode 100644
index 000000000..b89473f51
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/74-Search-A-2D-Matrix.c
@@ -0,0 +1,47 @@
+/*
+ Given a 2d matrix, where,
+ 1. the rows are sorted from left to right,
+ 2. the last element of each row is less than first element of next row
+
+ Find an efficient method to search for a given element in this array
+ Ex. matrix = [[ 1, 3, 5, 7],
+ [10, 11, 16, 20],
+ [23, 30, 34, 60]],
+ target = 3 -> true (3 exists)
+
+ The 2D matrix can be thought of as a 1D array if the rows are arranged
+ sequentially. And given the conditions, the 1D array will also be sorted.
+ So, binary search can be used to solve this problem with indexes (row, col)
+ rather than one.
+
+ Time: O(log(mn))
+ Space: O(1)
+*/
+
+bool searchMatrix(int** matrix, int matrixSize, int* matrixColSize, int target){
+ int m = matrixSize;
+ int n = *matrixColSize;
+
+ int low = 0;
+ int high = m*n - 1;
+
+ int mid = low + (high - low)/2;
+
+
+ while (low <= high) {
+ int row = mid / n;
+ int col = mid % n;
+
+ if (matrix[row][col] > target)
+ high = mid - 1;
+ else if (matrix[row][col] < target)
+ low = mid + 1;
+ else
+ return true;
+ mid = low + (high - low)/2;
+
+ }
+
+ return false;
+
+}
diff --git a/out/production/leetcode_Contribution/c/746-Min-Cost-Climbing-Stairs.c b/out/production/leetcode_Contribution/c/746-Min-Cost-Climbing-Stairs.c
new file mode 100644
index 000000000..be72b9dd1
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/746-Min-Cost-Climbing-Stairs.c
@@ -0,0 +1,9 @@
+int min(int a, int b) { return a > b ? b : a; }
+
+int minCostClimbingStairs(int *cost, int costSize) {
+
+ for (int i = 2; i < costSize; i++)
+ cost[i] += min(cost[i - 1], cost[i - 2]);
+
+ return min(cost[costSize - 1], cost[costSize - 2]);
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/c/75-Sort-Colors.c b/out/production/leetcode_Contribution/c/75-Sort-Colors.c
new file mode 100644
index 000000000..f4b0e57ca
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/75-Sort-Colors.c
@@ -0,0 +1,36 @@
+/*
+Given an array nums with n objects colored red, white, or blue, sort
+them in-place so that objects of the same color are adjacent, with
+the colors in the order red, white, and blue.
+
+Space: O(1)
+Time: O(n) (one-pass algorithm)
+*/
+
+
+void swap(int* nums, int a, int b) {
+ int tmp = nums[a];
+ nums[a] = nums[b];
+ nums[b] = tmp;
+}
+
+void sortColors(int* nums, int numsSize){
+ int pos1 = 0;
+ int right = numsSize-1;
+ int left = 0;
+ // Before index (left-pos1) -> only 0
+ // Between indexes (left-pos1) and left -> only 1
+ // After indexe left -> only 2
+ while (left<=right) {
+ if (nums[left]==2) {
+ swap(nums, left, right);
+ right--;
+ } else if (nums[left]==0) {
+ swap(nums, left, left-pos1);
+ left++;
+ } else {
+ pos1++;
+ left++;
+ }
+ }
+}
diff --git a/out/production/leetcode_Contribution/c/76-Minimum-Window-Substring.c b/out/production/leetcode_Contribution/c/76-Minimum-Window-Substring.c
new file mode 100644
index 000000000..133d96503
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/76-Minimum-Window-Substring.c
@@ -0,0 +1,51 @@
+/*
+Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every
+character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "".
+Space: O(1)
+Time: O(n+m) where n is the length of s and m the length of t
+*/
+
+char * minWindow(char * s, char * t){
+ int alpha[59] = {0};
+ int need = 0;
+ for (int i=0; t[i]!='\0'; i++) { // Initialise the alphabet
+ if (alpha[t[i]-'A']==0)
+ need++;
+ alpha[t[i]-'A']--;
+ }
+ int maxLen = 100001;
+ int pos=0;
+ int i=0, j=0;
+ while (s[j]!='\0') {
+ alpha[s[j]-'A']++;
+ if (alpha[s[j]-'A']==0) {
+ need--;
+ if (need==0) {
+ while (alpha[s[i]-'A']>0) {
+ alpha[s[i]-'A']--;
+ i++;
+ }
+ if ((j-i+1)0 && board[i-1][j]==word[1]){
+ if (dfs(board, n, m, i-1, j, word+1)){
+ board[i][j] = c;
+ return true;
+ }
+ }
+ if (j>0 && board[i][j-1]==word[1]){
+ if (dfs(board, n, m, i, j-1, word+1)){
+ board[i][j] = c;
+ return true;
+ }
+ }
+ if (i<(n-1) && board[i+1][j]==word[1]){
+ if (dfs(board, n, m, i+1, j, word+1)){
+ board[i][j] = c;
+ return true;
+ }
+ }
+ if (j<(m-1) && board[i][j+1]==word[1]){
+ if (dfs(board, n, m, i, j+1, word+1)){
+ board[i][j] = c;
+ return true;
+ }
+ }
+ board[i][j] = c;
+ return false;
+}
+
+
+bool exist(char** board, int boardSize, int* boardColSize, char * word){
+ int m = (*boardColSize), i, j;
+ for (i=0; icapacity = MAX_N;
+ stack->top = -1;
+ stack->array = (int *)malloc(stack->capacity * sizeof(int));
+ return stack;
+}
+
+int isFull(struct Stack *stack)
+{
+ return stack->top == stack->capacity - 1;
+}
+
+int isEmpty(struct Stack *stack)
+{
+ return stack->top == -1;
+}
+
+void push(struct Stack *stack, int val)
+{
+ if (isFull(stack))
+ return;
+ stack->array[++stack->top] = val;
+}
+
+void pop(struct Stack *stack)
+{
+ if (isEmpty(stack))
+ return;
+ --stack->top;
+}
+
+int peek(struct Stack *stack)
+{
+ if (isEmpty(stack))
+ return INT_MIN;
+ return stack->array[stack->top];
+}
+
+int max(int num1, int num2)
+{
+ return (num1 > num2) ? num1 : num2;
+}
+
+int largestRectangleArea(int *heights, int heightsSize)
+{
+ int ans = 0;
+ struct Stack *st = createStack();
+ for (int i = 0; i < heightsSize; i++)
+ {
+ while (!isEmpty(st) && heights[peek(st)] > heights[i])
+ {
+ int tp = peek(st);
+ pop(st);
+ int dist = (isEmpty(st) ? i : i - peek(st) - 1);
+ ans = max(ans, dist * heights[tp]);
+ }
+ push(st, i);
+ }
+ while (!isEmpty(st))
+ {
+ int tp = peek(st);
+ pop(st);
+ int dist = (isEmpty(st) ? heightsSize : heightsSize - peek(st) - 1);
+ ans = max(ans, dist * heights[tp]);
+ }
+ return ans;
+}
diff --git a/out/production/leetcode_Contribution/c/875-Koko-Eating-Bananas.c b/out/production/leetcode_Contribution/c/875-Koko-Eating-Bananas.c
new file mode 100644
index 000000000..6f33e8329
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/875-Koko-Eating-Bananas.c
@@ -0,0 +1,66 @@
+/*
+ Given an array of bananas piles containing differing amounts of bananas and
+ 'h' hours to eat all of them.
+ Determine the minimum speed (i.e. number of bananas per-hour) possible.
+
+ Ex. piles = [3,6,7,11], h = 8 -> 4
+
+ If all the bananas can be eaten with speed 'x' than the same holds true for
+ any speed more than 'x'. Similarly if bananas cannot be eated at speed 'y',
+ the same will be speeds less than 'y'.
+
+ Binary search can be performed on the possible values of speed till the
+ minimum speed is found with,
+ left bound = ceil(total/h)
+ right bound = maximum pile size
+
+ Time: O(NlogM) where N is number of piles and M is maximum pile size
+ Space: O(1)
+*/
+
+int hoursRequired(int* piles, int pilesSize, int h, int speed) {
+ int hours = 0;
+ for (int i = 0; i < pilesSize; ++i) {
+ hours += (piles[i]+speed-1)/speed;
+ }
+
+ return hours;
+}
+
+long sumOfArray(int* piles, int pilesSize) {
+ long total = 0l;
+
+ for (int i = 0; i < pilesSize; ++i) {
+ total += piles[i];
+ }
+
+ return total;
+}
+
+int maxElement(int* piles, int pilesSize) {
+ int maxElem = piles[0];
+
+ for (int i = 0; i < pilesSize; ++i) {
+ maxElem = fmax(maxElem, piles[i]);
+ }
+ return maxElem;
+}
+
+int minEatingSpeed(int* piles, int pilesSize, int h){
+ long total = sumOfArray(piles, pilesSize);
+
+ int l = (total+h-1)/h;
+ int r = maxElement(piles, pilesSize);
+
+ while (l < r) {
+ int mid = l + (r-l)/2;
+
+ int hours = hoursRequired(piles, pilesSize, h, mid);
+ if (hours <= h)
+ r = mid;
+ else if (hours > h)
+ l = mid + 1;
+ }
+
+ return r;
+}
diff --git a/out/production/leetcode_Contribution/c/88-Merge-Sorted-Array.c b/out/production/leetcode_Contribution/c/88-Merge-Sorted-Array.c
new file mode 100644
index 000000000..cec328b08
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/88-Merge-Sorted-Array.c
@@ -0,0 +1,27 @@
+/*
+Merge nums1 and nums2 into a single array sorted in non-decreasing order.
+
+Space: O(1)
+Time: O(n+m)
+*/
+
+void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n){
+ int i=m-1;
+ int j=n-1;
+ while (i>=0 || j>=0) {
+ if (j<0){ // Only numbers from nums1 remain
+ return;
+ } else if (i<0) { // Only numbers from nums2 remain
+ nums1[j] = nums2[j];
+ j--;
+ } else {
+ if (nums1[i]>nums2[j]) {
+ nums1[i+j+1] = nums1[i];
+ i--;
+ } else {
+ nums1[i+j+1] = nums2[j];
+ j--;
+ }
+ }
+ }
+}
diff --git a/out/production/leetcode_Contribution/c/881-Boats-To-Save-People.c b/out/production/leetcode_Contribution/c/881-Boats-To-Save-People.c
new file mode 100644
index 000000000..509845fc0
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/881-Boats-To-Save-People.c
@@ -0,0 +1,32 @@
+/*
+
+Space: O(n) (because of quicksort)
+Time: O(nlog(n)) (because of quicksort)
+*/
+
+int cmp(const void* a, const void* b) { // Function of comparison for quicksort
+ return *(int*)a - *(int*)b;
+}
+
+int numRescueBoats(int* people, int peopleSize, int limit){
+ int cpt=0;
+ qsort(people, peopleSize, sizeof(int), cmp);
+ int i=0;
+ int j=peopleSize-1;
+ while (people[i]+people[j] > limit && j>0)
+ j--;
+ cpt += peopleSize-j-1;
+ while (i=0; i--) {
+ if (s[i]=='0') { // Begin with a zero
+ dp[i] = 0;
+ } else if (s[i]=='1' || s[i]=='2') {
+ if (s[i]=='2' && s[i+1]>='7')
+ dp[i] = dp[i+2]; // Only one way to decode
+ else
+ dp[i] = dp[i+1] + dp[i+2]; // Two way to decode
+ } else {
+ dp[i] = dp[i+1]; // One way to decode
+ }
+ }
+ return dp[0];
+}
diff --git a/out/production/leetcode_Contribution/c/94-Binary-Tree-Inorder-Traversal.c b/out/production/leetcode_Contribution/c/94-Binary-Tree-Inorder-Traversal.c
new file mode 100644
index 000000000..8aa0a36ae
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/94-Binary-Tree-Inorder-Traversal.c
@@ -0,0 +1,23 @@
+/*
+Given the root of a binary tree, return the inorder traversal of its nodes' values.
+
+Space: O(n)
+Time: O(n)
+*/
+
+void fill_array(struct TreeNode* root, int* ans, int* pos) {
+ // Fill the array with the inorder traversal order
+ if (root==NULL)
+ return;
+ fill_array(root->left, ans, pos);
+ ans[*pos] = root->val;
+ *pos = *pos +1;
+ fill_array(root->right, ans, pos);
+}
+
+int* inorderTraversal(struct TreeNode* root, int* returnSize){
+ int* ans = malloc(sizeof(int)*101); // 101 as a length as we don't know the max and its inferior of 100
+ *returnSize = 0; // Current position in the array
+ fill_array(root, ans, returnSize);
+ return ans;
+}
diff --git a/out/production/leetcode_Contribution/c/953-Verifying-An-Alien-Dictionary.c b/out/production/leetcode_Contribution/c/953-Verifying-An-Alien-Dictionary.c
new file mode 100644
index 000000000..dfa59f725
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/953-Verifying-An-Alien-Dictionary.c
@@ -0,0 +1,34 @@
+/*
+Given a sequence of words written in the alien language, and the
+order of the alphabet, return true if and only if the given words
+are sorted lexicographically in this alien language.
+
+Space: O(1)
+Time: O(n*m)
+(Where n is the number of words and m the average length of the elements in words)
+*/
+
+
+bool isAlienSorted(char ** words, int wordsSize, char * order){
+ int alphabet[26] = {0};
+ for (int i=0; i<26; i++)
+ alphabet[order[i] - 'a'] = i;
+ for (int i=1; iv_i){
+ return false;
+ }
+ break;
+ }
+ j++;
+ }
+ if (words[i-1][j]!='\0' && words[i][j] == '\0'){ // If words[i] is shorter than words[i-1]
+ return false;
+ }
+ }
+ return true;
+}
diff --git a/out/production/leetcode_Contribution/c/96-Unique-Binary-Search-Tree.c b/out/production/leetcode_Contribution/c/96-Unique-Binary-Search-Tree.c
new file mode 100644
index 000000000..be86d3978
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/96-Unique-Binary-Search-Tree.c
@@ -0,0 +1,20 @@
+/*
+Given an integer n, return the number of structurally unique BST's
+(binary search trees) which has exactly n nodes of unique values from 1 to n.
+
+Space: O(n)
+Time: O(n²)
+*/
+
+int numTrees(int n){
+ int* dp = (int*)malloc(sizeof(int)*(n+1));
+ dp[0]=dp[1]=1;
+ for (int i=2; i<(n+1); i++){
+ dp[i] = 0;
+ for (int j=1; j<(i+1); j++){
+ dp[i]+=dp[j-1]*dp[i-j];
+ }
+ }
+ // We could free dp
+ return dp[n];
+}
diff --git a/out/production/leetcode_Contribution/c/98-Validate-Binary-Search-Tree.c b/out/production/leetcode_Contribution/c/98-Validate-Binary-Search-Tree.c
new file mode 100644
index 000000000..fd8bbc13e
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/98-Validate-Binary-Search-Tree.c
@@ -0,0 +1,18 @@
+/*
+Given the root of a binary tree, determine if it is a valid binary search tree (BST).
+Time: O(n)
+Space: O(1)
+*/
+
+#define MAX 9223372036854775807
+#define MIN -9223372036854775808
+
+bool isSubTreeValid(struct TreeNode* root, long int lowerBound, long int upperBound) {
+ if (root==NULL)
+ return true;
+ return root->valval>lowerBound && isSubTreeValid(root->left, lowerBound, root->val) && isSubTreeValid(root->right, root->val, upperBound);
+}
+
+bool isValidBST(struct TreeNode* root){
+ return isSubTreeValid(root, MIN, MAX);
+}
diff --git a/out/production/leetcode_Contribution/c/994-Rotting-Oranges.c b/out/production/leetcode_Contribution/c/994-Rotting-Oranges.c
new file mode 100644
index 000000000..7286b5040
--- /dev/null
+++ b/out/production/leetcode_Contribution/c/994-Rotting-Oranges.c
@@ -0,0 +1,43 @@
+
+int directions[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
+
+bool rotting_process(int** grid, int rows, int cols, int timestamp) {
+ bool continue_process = false;
+ for (int row = 0; row < rows; row++) {
+ for (int col = 0; col < cols; col++) {
+ if (grid[row][col] == timestamp) {
+ for (int i = 0; i < 4; i++) {
+ int r = row + directions[i][0];
+ int c = col + directions[i][1];
+ if (rows > r && r >= 0 && cols > c && c >= 0) {
+ if (grid[r][c] == 1) {
+ grid[r][c] = timestamp + 1;
+ continue_process = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return continue_process;
+}
+
+int orangesRotting(int** grid, int gridSize, int* gridColSize){
+
+ int rows = gridSize;
+ int cols = gridColSize[0];
+
+ int timestamp = 2;
+ while (rotting_process(grid, rows, cols, timestamp)) {
+ timestamp += 1;
+ }
+
+ for (int row = 0; row < rows; row++) {
+ for (int col = 0; col < cols; col++) {
+ if (grid[row][col] == 1) {
+ return -1;
+ }
+ }
+ }
+ return timestamp - 2;
+}
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/com/coding/patterns/tree/0205_isomorphic_strings b/out/production/leetcode_Contribution/com/coding/patterns/tree/0205_isomorphic_strings
new file mode 100644
index 000000000..22e2b9ffd
--- /dev/null
+++ b/out/production/leetcode_Contribution/com/coding/patterns/tree/0205_isomorphic_strings
@@ -0,0 +1,19 @@
+class Solution {
+ public boolean isIsomorphic(String s, String t) {
+ HashMap mapST = new HashMap();
+ HashMap mapTS = new HashMap();
+
+ for(int i = 0; i < s.length(); i++) {
+ char c1 = s.charAt(i);
+ char c2 = t.charAt(i);
+
+ if(mapST.containsKey(c1) && !mapST.get(c1).equals(c2) || mapTS.containsKey(c2) && !mapTS.get(c2).equals(c1)) {
+ return false;
+ }
+
+ mapST.put(c1,c2);
+ mapTS.put(c2,c1);
+ }
+ return true;
+ }
+}
diff --git a/out/production/leetcode_Contribution/com/coding/patterns/tree/1189-Maximum-Number-of-Balloons b/out/production/leetcode_Contribution/com/coding/patterns/tree/1189-Maximum-Number-of-Balloons
new file mode 100644
index 000000000..6848a6cdd
--- /dev/null
+++ b/out/production/leetcode_Contribution/com/coding/patterns/tree/1189-Maximum-Number-of-Balloons
@@ -0,0 +1,33 @@
+class Solution {
+ public int maxNumberOfBalloons(String text) {
+ HashMap balloon = new HashMap<>();
+ HashMap countText = new HashMap<>();
+
+ char[] balloonArray = "balloon".toCharArray();
+
+ for (char c : balloonArray) {
+ if (balloon.containsKey(c)) {
+ balloon.put(c,balloon.get(c)+1);
+ } else {
+ balloon.put(c,1);
+ }
+ }
+
+ char[] countTextArray = text.toCharArray();
+
+ for (char c : countTextArray) {
+ if (countText.containsKey(c)) {
+ countText.put(c,countText.get(c)+1);
+ } else {
+ countText.put(c,1);
+ }
+ }
+
+ int res = text.length();
+ for (Character c : balloon.keySet()) {
+ res = Math.min(res,countText.getOrDefault(c,0) / balloon.get(c));
+ }
+
+ return res;
+ }
+}
diff --git a/out/production/leetcode_Contribution/com/coding/patterns/tree/290-word-pattern b/out/production/leetcode_Contribution/com/coding/patterns/tree/290-word-pattern
new file mode 100644
index 000000000..0edd966b6
--- /dev/null
+++ b/out/production/leetcode_Contribution/com/coding/patterns/tree/290-word-pattern
@@ -0,0 +1,26 @@
+class Solution {
+ public boolean wordPattern(String pattern, String s) {
+ String[] sArray = s.split("\s");
+ if(sArray.length != pattern.length()) {
+ return false;
+ }
+
+ HashMap charToWord = new HashMap<>();
+ HashMap wordToChar = new HashMap<>();
+
+ for (int i = 0; i < pattern.length(); i++) {
+
+ if(charToWord.containsKey(pattern.charAt(i)) && !charToWord.get(pattern.charAt(i)).equals(sArray[i])) {
+ return false;
+ }
+
+ if(wordToChar.containsKey(sArray[i]) && !wordToChar.get(sArray[i]).equals(pattern.charAt(i))) {
+ return false;
+ }
+
+ charToWord.put(pattern.charAt(i),sArray[i]);
+ wordToChar.put(sArray[i],pattern.charAt(i));
+ }
+ return true;
+ }
+}
diff --git a/out/production/leetcode_Contribution/com/coding/patterns/tree/724-Find-Pivot-Index b/out/production/leetcode_Contribution/com/coding/patterns/tree/724-Find-Pivot-Index
new file mode 100644
index 000000000..d4ea35b86
--- /dev/null
+++ b/out/production/leetcode_Contribution/com/coding/patterns/tree/724-Find-Pivot-Index
@@ -0,0 +1,17 @@
+class Solution {
+ public int pivotIndex(int[] nums) {
+ int totalSum = 0;
+ for (int i = 0; i < nums.length; i++) {
+ totalSum += nums[i];
+ }
+ int leftSum = 0;
+ for (int i = 0; i < nums.length; i++) {
+ int rightSum = totalSum - leftSum - nums[i];
+ if (leftSum == rightSum) {
+ return i;
+ }
+ leftSum += nums[i];
+ }
+ return -1;
+ }
+}
diff --git a/out/production/leetcode_Contribution/cpp/1-Two-Sum.cpp b/out/production/leetcode_Contribution/cpp/1-Two-Sum.cpp
new file mode 100644
index 000000000..d70e01dac
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1-Two-Sum.cpp
@@ -0,0 +1,30 @@
+/*
+ Given int array & target, return indices of 2 nums that add to target
+ Ex. nums = [2,7,11,15] & target = 9 -> [0,1], 2 + 7 = 9
+
+ At each num, calculate complement, if exists in hash map then return
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ vector twoSum(vector& nums, int target) {
+ unordered_map m;
+ vector result;
+
+ for (int i = 0; i < nums.size(); i++) {
+ int complement = target - nums[i];
+ if (m.find(complement) != m.end()) {
+ result.push_back(m[complement]);
+ result.push_back(i);
+ break;
+ } else {
+ m.insert({nums[i], i});
+ }
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/10-Regular-Expression-Matching.cpp b/out/production/leetcode_Contribution/cpp/10-Regular-Expression-Matching.cpp
new file mode 100644
index 000000000..e8088e799
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/10-Regular-Expression-Matching.cpp
@@ -0,0 +1,49 @@
+/*
+ Given string & pattern, implement RegEx matching
+ '.' -> matches any single character
+ '*' -> matches zero or more of the preceding element
+ Matching should cover the entire input string (not partial)
+ Ex. s = "aa", p = "a" -> false, "a" doesn't match entire string "aa"
+
+ DFS + memo, 2 choices at a *: either use it, or don't use it
+
+ Time: O(m x n)
+ Space: O(m x n)
+*/
+
+class Solution {
+public:
+ bool isMatch(string s, string p) {
+ return dfs(s, p, 0, 0);
+ }
+private:
+ map, bool> dp;
+
+ bool dfs(string& s, string& p, int i, int j) {
+ if (dp.find({i, j}) != dp.end()) {
+ return dp[{i, j}];
+ }
+
+ if (i >= s.size() && j >= p.size()) {
+ return true;
+ }
+ if (j >= p.size()) {
+ return false;
+ }
+
+ bool match = i < s.size() && (s[i] == p[j] || p[j] == '.');
+ if (j + 1 < p.size() && p[j + 1] == '*') {
+ // choices: either (1) don't use *, or (2) use *
+ dp[{i, j}] = dfs(s, p, i, j + 2) || (match && dfs(s, p, i + 1, j));
+ return dp[{i, j}];
+ }
+
+ if (match) {
+ dp[{i, j}] = dfs(s, p, i + 1, j + 1);
+ return dp[{i, j}];
+ }
+
+ dp[{i, j}] = false;
+ return dp[{i, j}];
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/100-Same-Tree.cpp b/out/production/leetcode_Contribution/cpp/100-Same-Tree.cpp
new file mode 100644
index 000000000..b5843c9e7
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/100-Same-Tree.cpp
@@ -0,0 +1,36 @@
+/*
+ Given roots of 2 binary trees, check if they're the same or not (same structure & values)
+ Ex. p = [1,2,3] q = [1,2,3] -> true, p = [1,2] q = [1,null,2] -> false
+
+ Check: (1) matching nulls, (2) non-matching nulls, (3) non-matching values
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ bool isSameTree(TreeNode* p, TreeNode* q) {
+ if (p == NULL && q == NULL) {
+ return true;
+ }
+ if (p == NULL || q == NULL) {
+ return false;
+ }
+ if (p->val != q->val) {
+ return false;
+ }
+ return isSameTree(p->left, q->left) && isSameTree(p->right, q->right);
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/102-Binary-Tree-Level-Order-Traversal.cpp b/out/production/leetcode_Contribution/cpp/102-Binary-Tree-Level-Order-Traversal.cpp
new file mode 100644
index 000000000..cacee33ca
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/102-Binary-Tree-Level-Order-Traversal.cpp
@@ -0,0 +1,57 @@
+/*
+ Given root of binary tree, return level order traversal of its nodes (left to right)
+ Ex. root = [3,9,20,null,null,15,7] -> [[3],[9,20],[15,7]]
+
+ Standard BFS traversal, at each level, push left & right nodes if they exist to queue
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ vector> levelOrder(TreeNode* root) {
+ vector> result;
+
+ if (root == NULL) {
+ return result;
+ }
+
+ queue q;
+ q.push(root);
+
+ while (!q.empty()) {
+ int count = q.size();
+ vector curr;
+
+ for (int i = 0; i < count; i++) {
+ TreeNode* node = q.front();
+ q.pop();
+
+ curr.push_back(node->val);
+
+ if (node->left != NULL) {
+ q.push(node->left);
+ }
+ if (node->right != NULL) {
+ q.push(node->right);
+ }
+ }
+
+ result.push_back(curr);
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/104-Maximum-Depth-Of-Binary-Tree.cpp b/out/production/leetcode_Contribution/cpp/104-Maximum-Depth-Of-Binary-Tree.cpp
new file mode 100644
index 000000000..75a76f696
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/104-Maximum-Depth-Of-Binary-Tree.cpp
@@ -0,0 +1,56 @@
+/*
+ Given root of binary tree, return max depth (# nodes along longest path from root to leaf)
+
+ At every node, max depth is the max depth between its left & right children + 1
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ int maxDepth(TreeNode* root) {
+ if (root == NULL) {
+ return 0;
+ }
+ return 1 + max(maxDepth(root->left), maxDepth(root->right));
+ }
+};
+
+// class Solution {
+// public:
+// int maxDepth(TreeNode* root) {
+// if (root == NULL) {
+// return 0;
+// }
+// queue q;
+// q.push(root);
+// int result = 0;
+// while (!q.empty()) {
+// int count = q.size();
+// for (int i = 0; i < count; i++) {
+// TreeNode* node = q.front();
+// q.pop();
+// if (node->left != NULL) {
+// q.push(node->left);
+// }
+// if (node->right != NULL) {
+// q.push(node->right);
+// }
+// }
+// result++;
+// }
+// return result;
+// }
+// };
diff --git a/out/production/leetcode_Contribution/cpp/1046-Last-Stone-Weight.cpp b/out/production/leetcode_Contribution/cpp/1046-Last-Stone-Weight.cpp
new file mode 100644
index 000000000..12c70ccdb
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1046-Last-Stone-Weight.cpp
@@ -0,0 +1,35 @@
+/*
+ Given array of stones to smash, return smallest possible weight of last stone
+ If x == y both stones destroyed, if x != y stone x destroyed, stone y = y - x
+ Ex. stones = [2,7,4,1,8,1] -> 1, [2,4,1,1,1], [2,1,1,1], [1,1,1], [1]
+
+ Max heap, pop 2 biggest, push back difference until no more 2 elements left
+
+ Time: O(n log n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ int lastStoneWeight(vector& stones) {
+ priority_queue pq;
+ for (int i = 0; i < stones.size(); i++) {
+ pq.push(stones[i]);
+ }
+
+ while (pq.size() > 1) {
+ int y = pq.top();
+ pq.pop();
+ int x = pq.top();
+ pq.pop();
+ if (y > x) {
+ pq.push(y - x);
+ }
+ }
+
+ if (pq.empty()) {
+ return 0;
+ }
+ return pq.top();
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/105-Construct-Binary-Tree-From-Preorder-And-Inorder.cpp b/out/production/leetcode_Contribution/cpp/105-Construct-Binary-Tree-From-Preorder-And-Inorder.cpp
new file mode 100644
index 000000000..b577dc928
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/105-Construct-Binary-Tree-From-Preorder-And-Inorder.cpp
@@ -0,0 +1,50 @@
+/*
+ Given 2 integer arrays preorder & inorder, construct & return the binary tree
+ Ex. preorder = [3,9,20,15,7], inorder = [9,3,15,20,7] -> [3,9,20,null,null,15,7]
+
+ Preorder dictates nodes, inorder dictates subtrees (preorder values, inorder positions)
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ TreeNode* buildTree(vector& preorder, vector& inorder) {
+ int index = 0;
+ return build(preorder, inorder, index, 0, inorder.size() - 1);
+ }
+private:
+ TreeNode* build(vector& preorder, vector& inorder, int& index, int i, int j) {
+ if (i > j) {
+ return NULL;
+ }
+
+ TreeNode* root = new TreeNode(preorder[index]);
+
+ int split = 0;
+ for (int i = 0; i < inorder.size(); i++) {
+ if (preorder[index] == inorder[i]) {
+ split = i;
+ break;
+ }
+ }
+ index++;
+
+ root->left = build(preorder, inorder, index, i, split - 1);
+ root->right = build(preorder, inorder, index, split + 1, j);
+
+ return root;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/11-Container-With-Most-Water.cpp b/out/production/leetcode_Contribution/cpp/11-Container-With-Most-Water.cpp
new file mode 100644
index 000000000..5d5ff435d
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/11-Container-With-Most-Water.cpp
@@ -0,0 +1,33 @@
+/*
+ Given array of heights, find max water container can store
+ Ex. height = [1,8,6,2,5,4,8,3,7] -> 49, (8 - 1) x min(8, 7)
+
+ 2 pointers outside in, greedily iterate pointer w/ lower height
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ int maxArea(vector& height) {
+ int i = 0;
+ int j = height.size() - 1;
+
+ int curr = 0;
+ int result = 0;
+
+ while (i < j) {
+ curr = (j - i) * min(height[i], height[j]);
+ result = max(result, curr);
+
+ if (height[i] <= height[j]) {
+ i++;
+ } else {
+ j--;
+ }
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/110-Balanced-Binary-Tree.cpp b/out/production/leetcode_Contribution/cpp/110-Balanced-Binary-Tree.cpp
new file mode 100644
index 000000000..751c3e21f
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/110-Balanced-Binary-Tree.cpp
@@ -0,0 +1,47 @@
+/*
+ Given binary tree, determine if height-balanced (all left & right subtrees height diff <= 1)
+
+ Check if subtrees are balanced, if so, use their heights to determine further balance
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ bool isBalanced(TreeNode* root) {
+ int height = 0;
+ return dfs(root, height);
+ }
+private:
+ bool dfs(TreeNode* root, int& height) {
+ if (root == NULL) {
+ height = -1;
+ return true;
+ }
+
+ int left = 0;
+ int right = 0;
+
+ if (!dfs(root->left, left) || !dfs(root->right, right)) {
+ return false;
+ }
+ if (abs(left - right) > 1) {
+ return false;
+ }
+
+ height = 1 + max(left, right);
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1143-Longest-Common-Subsequence.cpp b/out/production/leetcode_Contribution/cpp/1143-Longest-Common-Subsequence.cpp
new file mode 100644
index 000000000..43cbe1947
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1143-Longest-Common-Subsequence.cpp
@@ -0,0 +1,37 @@
+/*
+ Given 2 strings, return length of longest common subsequence
+ Ex. text1 = "abcde", text2 = "ace" -> 3, "ace" is LCS
+
+ j
+ a c e
+ a 3
+ b 2 --> visualization of below, build DP bottom-up
+ i c 2
+ d 1
+ e 1
+
+ Time: O(m x n)
+ Space: O(m x n)
+*/
+
+class Solution {
+public:
+ int longestCommonSubsequence(string text1, string text2) {
+ int m = text1.size();
+ int n = text2.size();
+
+ vector> dp(m + 1, vector(n + 1));
+
+ for (int i = m - 1; i >= 0; i--) {
+ for (int j = n - 1; j >= 0; j--) {
+ if (text1[i] == text2[j]) {
+ dp[i][j] = 1 + dp[i + 1][j + 1];
+ } else {
+ dp[i][j] = max(dp[i + 1][j], dp[i][j + 1]);
+ }
+ }
+ }
+
+ return dp[0][0];
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/115-Distinct-Subsequences.cpp b/out/production/leetcode_Contribution/cpp/115-Distinct-Subsequences.cpp
new file mode 100644
index 000000000..bb6d371cb
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/115-Distinct-Subsequences.cpp
@@ -0,0 +1,41 @@
+/*
+ Given 2 strings s & t:
+ Return # of distinct subsequences of s which equals t
+ Ex. s = "rabbbit", t = "rabbit" -> 3, RABBbIT, RAbBBIT, RABbBIT
+
+ DFS + memo, cache on i & j indices to the # of distinct subseq
+ 2 choices: if chars equal, look at remainder of both s & t
+ if chars not equal, only look at remainder of s
+
+ Time: O(m x n)
+ Space: O(m x n)
+*/
+
+class Solution {
+public:
+ int numDistinct(string s, string t) {
+ return dfs(s, t, 0, 0);
+ }
+private:
+ // {(i, j) -> # of distinct subsequences}
+ map, int> dp;
+
+ int dfs(string& s, string& t, int i, int j) {
+ if (j == t.size()) {
+ return 1;
+ }
+ if (i == s.size()) {
+ return 0;
+ }
+ if (dp.find({i, j}) != dp.end()) {
+ return dp[{i, j}];
+ }
+
+ if (s[i] == t[j]) {
+ dp[{i, j}] = dfs(s, t, i + 1, j + 1) + dfs(s, t, i + 1, j);
+ } else {
+ dp[{i, j}] = dfs(s, t, i + 1, j);
+ }
+ return dp[{i, j}];
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/118-Pascals-Triangle.cpp b/out/production/leetcode_Contribution/cpp/118-Pascals-Triangle.cpp
new file mode 100644
index 000000000..348bc756b
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/118-Pascals-Triangle.cpp
@@ -0,0 +1,17 @@
+class Solution {
+public:
+ vector> generate(int numRows)
+ {
+ vector> ret;
+
+ for(int i = 0; i < numRows ; i++){
+ vector row(i+1, 1);
+ for(int j = 1; j < i ; j++){
+ row[j] = ret[i-1][j] + ret[i-1][j-1];
+ }
+ ret.push_back(row);
+ }
+
+ return ret;
+ }
+};
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/cpp/120-Triangle.cpp b/out/production/leetcode_Contribution/cpp/120-Triangle.cpp
new file mode 100644
index 000000000..d35c0e184
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/120-Triangle.cpp
@@ -0,0 +1,21 @@
+class Solution{
+ public:
+ int minimumTotal(vector>& triangle){
+ for(int i = 0; i < triangle.size() - 1; i++){
+ for(int k = 0; k < triangle[i + 1].size(); k++){
+ if(k == 0){
+ triangle[i + 1][0] = triangle[i + 1][0] + triangle[i][0];
+ }
+ else{
+ if(k == triangle[i + 1].size() - 1){
+ triangle[i + 1][k] = triangle[i + 1][k] + triangle[i][k - 1];
+ }
+ else{
+ triangle[i + 1][k] = triangle[i + 1][k] + min(triangle[i][k - 1], triangle[i][k]);
+ }
+ }
+ }
+ }
+ return *min_element(triangle[triangle.size() - 1].begin(), triangle[triangle.size() - 1].end());
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1209-Remove-All-Adjacent-Duplicates-in-String-II.cpp b/out/production/leetcode_Contribution/cpp/1209-Remove-All-Adjacent-Duplicates-in-String-II.cpp
new file mode 100644
index 000000000..26afe7e18
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1209-Remove-All-Adjacent-Duplicates-in-String-II.cpp
@@ -0,0 +1,39 @@
+// Time and space complexity is O(n) where n is the size of the input string.
+class Solution {
+public:
+ string removeDuplicates(string s, int k) {
+ stack> st;
+
+ for(int i = 0 ; i < s.size(); i++)
+ {
+ int count = 1;
+ if(!st.empty() && st.top().first == s[i])
+ {
+ count += st.top().second;
+ st.pop();
+ }
+
+ st.push({s[i] , count});
+
+ if(count == k) st.pop();
+
+ }
+
+ string ans = "";
+ while(!st.empty())
+ {
+ int freq = st.top().second;
+ int c = st.top().first;
+ while(freq > 0)
+ {
+ ans += c;
+ freq--;
+ }
+
+ st.pop();
+ }
+
+ reverse(ans.begin() , ans.end());
+ return ans;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/121-Best-Time-To-Buy-And-Sell-Stock.cpp b/out/production/leetcode_Contribution/cpp/121-Best-Time-To-Buy-And-Sell-Stock.cpp
new file mode 100644
index 000000000..54afd242b
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/121-Best-Time-To-Buy-And-Sell-Stock.cpp
@@ -0,0 +1,24 @@
+/*
+ Given array prices, return max profit w/ 1 buy & 1 sell
+ Ex. prices = [7,1,5,3,6,4] -> 5 (buy at $1, sell at $6)
+
+ For each, get diff b/w that & min value before, store max
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ int maxProfit(vector& prices) {
+ int minValue = prices[0];
+ int maxDiff = 0;
+
+ for (int i = 1; i < prices.size(); i++) {
+ minValue = min(minValue, prices[i]);
+ maxDiff = max(maxDiff, prices[i] - minValue);
+ }
+
+ return maxDiff;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1213-Maximum-Product-Difference-Between-Two-Pairs.cpp b/out/production/leetcode_Contribution/cpp/1213-Maximum-Product-Difference-Between-Two-Pairs.cpp
new file mode 100644
index 000000000..fa74d7a3a
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1213-Maximum-Product-Difference-Between-Two-Pairs.cpp
@@ -0,0 +1,7 @@
+class Solution{
+ public:
+ int maxProductDifference(vector& nums){
+ sort(nums.begin(), nums.end());
+ return nums.rbegin()[1] * nums.back() - nums[0] * nums[1];
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/124-Binary-Tree-Maximum-Path-Sum.cpp b/out/production/leetcode_Contribution/cpp/124-Binary-Tree-Maximum-Path-Sum.cpp
new file mode 100644
index 000000000..751da2414
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/124-Binary-Tree-Maximum-Path-Sum.cpp
@@ -0,0 +1,42 @@
+/*
+ Given root of binary tree, return max path sum (seq of adj node values added together)
+
+ Path can only have <= 1 split point, assume curPath has it, so return can't split again
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ int maxPathSum(TreeNode* root) {
+ int maxPath = INT_MIN;
+ dfs(root, maxPath);
+ return maxPath;
+ }
+private:
+ int dfs(TreeNode* root, int& maxPath) {
+ if (root == NULL) {
+ return 0;
+ }
+
+ int left = max(dfs(root->left, maxPath), 0);
+ int right = max(dfs(root->right, maxPath), 0);
+
+ int curPath = root->val + left + right;
+ maxPath = max(maxPath, curPath);
+
+ return root->val + max(left, right);
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/125-Valid-Palindrome.cpp b/out/production/leetcode_Contribution/cpp/125-Valid-Palindrome.cpp
new file mode 100644
index 000000000..3f71d0254
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/125-Valid-Palindrome.cpp
@@ -0,0 +1,33 @@
+/*
+ Given a string s, return true if it's a palindrome
+ Ex. s = "A man, a plan, a canal: Panama" -> true
+
+ 2 pointers, outside in, skip non-letters & compare
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ bool isPalindrome(string s) {
+ int i = 0;
+ int j = s.size() - 1;
+
+ while (i < j) {
+ while (!isalnum(s[i]) && i < j) {
+ i++;
+ }
+ while (!isalnum(s[j]) && i < j) {
+ j--;
+ }
+ if (tolower(s[i]) != tolower(s[j])) {
+ return false;
+ }
+ i++;
+ j--;
+ }
+
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/127-Word-Ladder.cpp b/out/production/leetcode_Contribution/cpp/127-Word-Ladder.cpp
new file mode 100644
index 000000000..6d698aed2
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/127-Word-Ladder.cpp
@@ -0,0 +1,55 @@
+/*
+ Given 2 words & a dictionary, return min # of words to transform b/w them
+ Ex. begin = "hit", end = "cog", dict = ["hot","dot","dog","lot","log","cog"] -> 5
+ "hit" -> "hot" -> "dot" -> "dog" -> "cog"
+
+ BFS, change 1 letter at a time (neighbors), if in dict add to queue, else skip
+
+ Time: O(m^2 x n) -> m = length of each word, n = # of words in input word list
+ Space: O(m^2 x n)
+*/
+
+class Solution {
+public:
+ int ladderLength(string beginWord, string endWord, vector& wordList) {
+ unordered_set dict;
+ for (int i = 0; i < wordList.size(); i++) {
+ dict.insert(wordList[i]);
+ }
+
+ queue q;
+ q.push(beginWord);
+
+ int result = 1;
+
+ while (!q.empty()) {
+ int count = q.size();
+
+ for (int i = 0; i < count; i++) {
+ string word = q.front();
+ q.pop();
+
+ if (word == endWord) {
+ return result;
+ }
+ dict.erase(word);
+
+ for (int j = 0; j < word.size(); j++) {
+ char c = word[j];
+ for (int k = 0; k < 26; k++) {
+ word[j] = k + 'a';
+ if (dict.find(word) != dict.end()) {
+ q.push(word);
+ dict.erase(word);
+ }
+ word[j] = c;
+ }
+ }
+ }
+
+ result++;
+ }
+
+ return 0;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/128-Longest-Consecutive-Sequence.cpp b/out/production/leetcode_Contribution/cpp/128-Longest-Consecutive-Sequence.cpp
new file mode 100644
index 000000000..bba4acb52
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/128-Longest-Consecutive-Sequence.cpp
@@ -0,0 +1,29 @@
+/*
+ Given unsorted array, return length of longest consecutive sequence
+ Ex. nums = [100,4,200,1,3,2] -> 4, longest is [1,2,3,4]
+
+ Store in hash set, only check for longer seq if it's the beginning
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+
+class Solution {
+public:
+ int longestConsecutive(vector& nums) {
+ unordered_sets(nums.begin(), nums.end());
+ int longest = 0;
+ for(auto &n: s){
+ //if this is the start of the sequence
+ if(!s.count(n - 1)){
+ int length = 1;
+ while(s.count(n + length))
+ ++length;
+ longest = max(longest, length);
+ }
+
+ }
+ return longest;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.cpp b/out/production/leetcode_Contribution/cpp/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.cpp
new file mode 100644
index 000000000..0116ad06a
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.cpp
@@ -0,0 +1,17 @@
+class Solution {
+public:
+ vector replaceElements(vector& arr) {
+ // O(N) Time Complexity , O(1) Space complexity
+ int n = arr.size();
+ int maxSoFar = arr[n-1];
+ arr[n-1] = -1;
+
+ for(int i=n-2;i>=0;i--)
+ {
+ int temp = maxSoFar;
+ if(maxSoFar < arr[i]) maxSoFar = arr[i];
+ arr[i] = temp;
+ }
+ return arr;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/130-Surrounded-Regions.cpp b/out/production/leetcode_Contribution/cpp/130-Surrounded-Regions.cpp
new file mode 100644
index 000000000..2b665a94e
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/130-Surrounded-Regions.cpp
@@ -0,0 +1,52 @@
+/*
+ Given a matrix, capture ('X') all regions that are surrounded ('O')
+
+ Distinguish captured vs escaped, 'X' vs 'O' vs 'E'
+
+ Time: O(m x n)
+ Space: O(m x n)
+*/
+
+class Solution {
+public:
+ void solve(vector>& board) {
+ int m = board.size();
+ int n = board[0].size();
+
+ // marking escaped cells along the border
+ for (int i = 0; i < m; i++) {
+ dfs(board,i,0,m,n);
+ dfs(board,i,n-1,m,n);
+ }
+
+ for (int j = 0; j < n; j++) {
+ dfs(board,0,j,m,n);
+ dfs(board,m-1,j,m,n);
+ }
+
+ // flip cells to correct final states
+ for (int i = 0; i < m; i++) {
+ for (int j = 0; j < n; j++) {
+ if (board[i][j] == 'O') {
+ board[i][j] = 'X';
+ }
+ if (board[i][j] == 'E') {
+ board[i][j] = 'O';
+ }
+ }
+ }
+ }
+private:
+ void dfs(vector>& board, int i, int j, int m, int n) {
+ if (i < 0 || i >= m || j < 0 || j >= n || board[i][j] != 'O') {
+ return;
+ }
+
+ board[i][j] = 'E';
+
+ dfs(board, i - 1, j, m, n);
+ dfs(board, i + 1, j, m, n);
+ dfs(board, i, j - 1, m, n);
+ dfs(board, i, j + 1, m, n);
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/131-Palindrome-Partitioning.cpp b/out/production/leetcode_Contribution/cpp/131-Palindrome-Partitioning.cpp
new file mode 100644
index 000000000..6d4866e7a
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/131-Palindrome-Partitioning.cpp
@@ -0,0 +1,44 @@
+/*
+ Given a string, partition such that every substring is a palindrome, return all possible ones
+ Ex. s = "aab" -> [["a","a","b"],["aa","b"]], s = "a" -> [["a"]]
+
+ Generate all possible substrings at idx, if palindrome potential candidate, backtrack after
+
+ Time: O(n x 2^n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ vector> partition(string s) {
+ vector curr;
+ vector> result;
+ dfs(s, 0, curr, result);
+ return result;
+ }
+private:
+ void dfs(string s, int start, vector& curr, vector>& result) {
+ if (start == s.size()) {
+ result.push_back(curr);
+ return;
+ }
+ for (int i = start; i < s.size(); i++) {
+ if (isPalindrome(s, start, i)) {
+ string str = s.substr(start, i - start + 1);
+ curr.push_back(str);
+ dfs(s, i + 1, curr, result);
+ curr.pop_back();
+ }
+ }
+ }
+ bool isPalindrome(string s, int left, int right) {
+ while (left < right) {
+ if (s[left] != s[right]) {
+ return false;
+ }
+ left++;
+ right--;
+ }
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/133-Clone-Graph.cpp b/out/production/leetcode_Contribution/cpp/133-Clone-Graph.cpp
new file mode 100644
index 000000000..12e35f0ea
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/133-Clone-Graph.cpp
@@ -0,0 +1,83 @@
+/*
+ Given ref of a node in connected undirected graph, return deep copy
+
+ Both BFS & DFS work, map original node to its copy
+
+ Time: O(m + n)
+ Space: O(n)
+*/
+
+/*
+// Definition for a Node.
+class Node {
+public:
+ int val;
+ vector neighbors;
+ Node() {
+ val = 0;
+ neighbors = vector();
+ }
+ Node(int _val) {
+ val = _val;
+ neighbors = vector();
+ }
+ Node(int _val, vector _neighbors) {
+ val = _val;
+ neighbors = _neighbors;
+ }
+};
+*/
+
+// class Solution {
+// public:
+// Node* cloneGraph(Node* node) {
+// if (node == NULL) {
+// return NULL;
+// }
+// if (m.find(node) == m.end()) {
+// m[node] = new Node(node->val);
+// for (int i = 0; i < node->neighbors.size(); i++) {
+// Node* neighbor = node->neighbors[i];
+// m[node]->neighbors.push_back(cloneGraph(neighbor));
+// }
+// }
+// return m[node];
+// }
+// private:
+// unordered_map m;
+// };
+
+class Solution {
+public:
+ Node* cloneGraph(Node* node) {
+ if (node == NULL) {
+ return NULL;
+ }
+
+ Node* copy = new Node(node->val);
+ m[node] = copy;
+
+ queue q;
+ q.push(node);
+
+ while (!q.empty()) {
+ Node* curr = q.front();
+ q.pop();
+
+ for (int i = 0; i < curr->neighbors.size(); i++) {
+ Node* neighbor = curr->neighbors[i];
+
+ if (m.find(neighbor) == m.end()) {
+ m[neighbor] = new Node(neighbor->val);
+ q.push(neighbor);
+ }
+
+ m[curr]->neighbors.push_back(m[neighbor]);
+ }
+ }
+
+ return copy;
+ }
+private:
+ unordered_map m;
+};
diff --git a/out/production/leetcode_Contribution/cpp/134-Gas-Station.cpp b/out/production/leetcode_Contribution/cpp/134-Gas-Station.cpp
new file mode 100644
index 000000000..ff4c7468c
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/134-Gas-Station.cpp
@@ -0,0 +1,39 @@
+/*
+ Gas stations along circular route, return where to start to complete 1 trip
+ Ex. gas = [1,2,3,4,5] cost = [3,4,5,1,2] -> index 3 (station 4), tank = 4,8,7,6,5
+
+ At a start station, if total ever becomes negative won't work, try next station
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ int canCompleteCircuit(vector& gas, vector& cost) {
+ int n = gas.size();
+
+ int totalGas = 0;
+ int totalCost = 0;
+ for (int i = 0; i < n; i++) {
+ totalGas += gas[i];
+ totalCost += cost[i];
+ }
+ if (totalGas < totalCost) {
+ return -1;
+ }
+
+ int total = 0;
+ int result = 0;
+
+ for (int i = 0; i < n; i++) {
+ total += gas[i] - cost[i];
+ if (total < 0) {
+ total = 0;
+ result = i + 1;
+ }
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/136-Single-Number.cpp b/out/production/leetcode_Contribution/cpp/136-Single-Number.cpp
new file mode 100644
index 000000000..e20ac227f
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/136-Single-Number.cpp
@@ -0,0 +1,22 @@
+/*
+ Given int array, every element appears twice except 1, find it
+ Ex. nums = [2,2,1] -> 1, nums = [4,1,2,1,2] -> 4
+
+ a XOR a returns 0, so returns 0 for all except the unique one
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ int singleNumber(vector& nums) {
+ int result = 0;
+
+ for (int i = 0; i < nums.size(); i++) {
+ result = result ^ nums[i];
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/138-Copy-List-With-Random-Pointer.cpp b/out/production/leetcode_Contribution/cpp/138-Copy-List-With-Random-Pointer.cpp
new file mode 100644
index 000000000..e280b11bd
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/138-Copy-List-With-Random-Pointer.cpp
@@ -0,0 +1,101 @@
+/*
+ Given linked list w/ also a random pointer, construct deep copy
+
+ Hash map {old -> new}, O(n) space
+ Optimize interweave old and new nodes, O(1) space
+ A -> A' -> B -> B' -> C -> C', A'.random = A.random.next
+
+ Time: O(n)
+ Space: O(n) -> can optimize to O(1)
+*/
+
+/*
+// Definition for a Node.
+class Node {
+public:
+ int val;
+ Node* next;
+ Node* random;
+
+ Node(int _val) {
+ val = _val;
+ next = NULL;
+ random = NULL;
+ }
+};
+*/
+
+// class Solution {
+// public:
+// Node* copyRandomList(Node* head) {
+// if (head == NULL) {
+// return NULL;
+// }
+// Node* oldNode = head;
+// Node* newNode = new Node(oldNode->val);
+// visited[oldNode] = newNode;
+// while (oldNode != NULL) {
+// newNode->next = getClonedNode(oldNode->next);
+// newNode->random = getClonedNode(oldNode->random);
+// oldNode = oldNode->next;
+// newNode = newNode->next;
+// }
+// return visited[head];
+// }
+// private:
+// unordered_map visited;
+// Node* getClonedNode(Node* node) {
+// if (node == NULL) {
+// return NULL;
+// }
+// if (visited.find(node) != visited.end()) {
+// return visited[node];
+// }
+// visited[node] = new Node(node->val);
+// return visited[node];
+// }
+// };
+
+class Solution {
+public:
+ Node* copyRandomList(Node* head) {
+ if (head == NULL) {
+ return NULL;
+ }
+
+ Node* ptr = head;
+ while (ptr != NULL) {
+ Node* newNode = new Node(ptr->val);
+ newNode->next = ptr->next;
+ ptr->next = newNode;
+ ptr = newNode->next;
+ }
+ ptr = head;
+
+ while (ptr != NULL) {
+ if (ptr->random == NULL) {
+ ptr->next->random == NULL;
+ } else {
+ ptr->next->random = ptr->random->next;
+ }
+ ptr = ptr->next->next;
+ }
+
+ Node* oldPtr = head;
+ Node* newPtr = head->next;
+ Node* oldHead = head->next;
+
+ while (oldPtr != NULL) {
+ oldPtr->next = oldPtr->next->next;
+ if (newPtr->next == NULL) {
+ newPtr->next = NULL;
+ } else {
+ newPtr->next = newPtr->next->next;
+ }
+ oldPtr = oldPtr->next;
+ newPtr = newPtr->next;
+ }
+
+ return oldHead;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/139-Word-Break.cpp b/out/production/leetcode_Contribution/cpp/139-Word-Break.cpp
new file mode 100644
index 000000000..c0613d33e
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/139-Word-Break.cpp
@@ -0,0 +1,37 @@
+/*
+ Given a string & dictionary, return true if:
+ Can segment string into 1 or more dictionary words
+
+ DP, at each loop, substring, check if in dict, & store
+
+ Time: O(n^3)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ bool wordBreak(string s, vector& wordDict) {
+ unordered_set words;
+ for (int i = 0; i < wordDict.size(); i++) {
+ words.insert(wordDict[i]);
+ }
+
+ int n = s.size();
+ vector dp(n + 1);
+ dp[0] = true;
+
+ for (int i = 1; i <= n; i++) {
+ for (int j = i - 1; j >= 0; j--) {
+ if (dp[j]) {
+ string word = s.substr(j, i - j);
+ if (words.find(word) != words.end()) {
+ dp[i] = true;
+ break;
+ }
+ }
+ }
+ }
+
+ return dp[n];
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/14-4Sum.cpp b/out/production/leetcode_Contribution/cpp/14-4Sum.cpp
new file mode 100644
index 000000000..da43c223e
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/14-4Sum.cpp
@@ -0,0 +1,59 @@
+class Solution {
+public:
+ vector> res;
+
+ vector> fourSum(vector& nums, int target) {
+
+ if(nums.size() < 4) return res;
+
+ vectorquad;
+ sort(nums.begin() , nums.end());
+ kSum(0,4,target,nums,quad);
+ return res;
+ }
+
+
+ void kSum (int index , int k , long long target, vector nums , vector&q)
+ {
+
+ if(k == 2)
+ {
+ twoSum(index , target, q , nums);
+ return;
+ }
+
+ for(int i = index ; i < nums.size() - k + 1; i++)
+ {
+ if(i > index && nums[i] == nums[i-1]) continue;
+ q.push_back(nums[i]);
+ kSum(i+1 , k-1 , target-nums[i] , nums , q);
+ q.pop_back();
+ }
+
+ }
+
+ void twoSum (int start,long long target,vector&ans,vector& nums)
+ {
+ int lo = start;
+ int hi = nums.size()-1;
+
+ while(lo < hi)
+ {
+ int sum = nums[lo]+nums[hi];
+ if(sum > target) hi--;
+ else if (sum < target) lo++;
+
+ else
+ {
+ ans.insert(ans.end() , {nums[lo] , nums[hi]});
+ res.push_back(ans);
+
+ ans.pop_back();
+ ans.pop_back();
+
+ lo++;
+ while (lo < hi && nums[lo] == nums[lo - 1]) lo++;
+ }
+ }
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/141-Linked-List-Cycle.cpp b/out/production/leetcode_Contribution/cpp/141-Linked-List-Cycle.cpp
new file mode 100644
index 000000000..1745aacdc
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/141-Linked-List-Cycle.cpp
@@ -0,0 +1,38 @@
+/*
+ Given head of a linked list, determine if it has a cycle in it
+
+ Slow/fast pointers, if they ever intersect then there's a cycle
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode(int x) : val(x), next(NULL) {}
+ * };
+ */
+class Solution {
+public:
+ bool hasCycle(ListNode *head) {
+ if (head == NULL) {
+ return false;
+ }
+
+ ListNode* slow = head;
+ ListNode* fast = head;
+
+ while (fast->next != NULL && fast->next->next != NULL) {
+ slow = slow->next;
+ fast = fast->next->next;
+ if (slow == fast) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/143-Reorder-List.cpp b/out/production/leetcode_Contribution/cpp/143-Reorder-List.cpp
new file mode 100644
index 000000000..bbd971f32
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/143-Reorder-List.cpp
@@ -0,0 +1,75 @@
+/*
+ Given head of linked-list, reorder list alternating outside in
+ Ex. head = [1,2,3,4] -> [1,4,2,3], head = [1,2,3,4,5] -> [1,5,2,4,3]
+
+ Find middle node, split in half, reverse 2nd half of list, merge
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode() : val(0), next(nullptr) {}
+ * ListNode(int x) : val(x), next(nullptr) {}
+ * ListNode(int x, ListNode *next) : val(x), next(next) {}
+ * };
+ */
+class Solution {
+public:
+ void reorderList(ListNode* head) {
+ if (head->next == NULL) {
+ return;
+ }
+
+ ListNode* prev = NULL;
+ ListNode* slow = head;
+ ListNode* fast = head;
+
+ while (fast != NULL && fast->next != NULL) {
+ prev = slow;
+ slow = slow->next;
+ fast = fast->next->next;
+ }
+
+ prev->next = NULL;
+
+ ListNode* l1 = head;
+ ListNode* l2 = reverse(slow);
+
+ merge(l1, l2);
+ }
+private:
+ ListNode* reverse(ListNode* head) {
+ ListNode* prev = NULL;
+ ListNode* curr = head;
+ ListNode* next = curr->next;
+
+ while (curr != NULL) {
+ next = curr->next;
+ curr->next = prev;
+ prev = curr;
+ curr = next;
+ }
+
+ return prev;
+ }
+ void merge(ListNode* l1, ListNode* l2) {
+ while (l1 != NULL) {
+ ListNode* p1 = l1->next;
+ ListNode* p2 = l2->next;
+
+ l1->next = l2;
+ if (p1 == NULL) {
+ break;
+ }
+ l2->next = p1;
+
+ l1 = p1;
+ l2 = p2;
+ }
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1448-Count-Good-Nodes-In-Binary-Tree.cpp b/out/production/leetcode_Contribution/cpp/1448-Count-Good-Nodes-In-Binary-Tree.cpp
new file mode 100644
index 000000000..e59e372ad
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1448-Count-Good-Nodes-In-Binary-Tree.cpp
@@ -0,0 +1,41 @@
+/*
+ Given binary tree, node is "good" if path from root has no nodes > X, return # of "good"
+
+ Maintain greatest value seen so far on a path, if further node >= this max, "good" node
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ int goodNodes(TreeNode* root) {
+ int result = 0;
+ dfs(root, root->val, result);
+ return result;
+ }
+private:
+ void dfs(TreeNode* root, int maxSoFar, int& result) {
+ if (root == NULL) {
+ return;
+ }
+
+ if (root->val >= maxSoFar) {
+ result++;
+ }
+
+ dfs(root->left, max(maxSoFar, root->val), result);
+ dfs(root->right, max(maxSoFar, root->val), result);
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/146-Lru-Cache.cpp b/out/production/leetcode_Contribution/cpp/146-Lru-Cache.cpp
new file mode 100644
index 000000000..32011eff9
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/146-Lru-Cache.cpp
@@ -0,0 +1,100 @@
+/*
+ Design data structure that follows constraints of an LRU cache
+
+ Hash map + doubly linked list, left = LRU, right = MRU
+ get: update to MRU, put: update to MRU, remove LRU if full
+
+ Time: O(1)
+ Space: O(capacity)
+*/
+
+class Node {
+public:
+ int k;
+ int val;
+ Node* prev;
+ Node* next;
+
+ Node(int key, int value) {
+ k = key;
+ val = value;
+ prev = NULL;
+ next = NULL;
+ }
+};
+
+class LRUCache {
+public:
+ LRUCache(int capacity) {
+ cap = capacity;
+
+ left = new Node(0, 0);
+ right = new Node(0, 0);
+
+ left->next = right;
+ right->prev = left;
+ }
+
+ int get(int key) {
+ if (cache.find(key) != cache.end()) {
+ remove(cache[key]);
+ insert(cache[key]);
+ return cache[key]->val;
+ }
+ return -1;
+ }
+
+ void put(int key, int value) {
+ if (cache.find(key) != cache.end()) {
+ remove(cache[key]);
+
+ // Free allocated memory for the removed node
+ delete cache[key];
+ }
+ cache[key] = new Node(key, value);
+ insert(cache[key]);
+
+ if (cache.size() > cap) {
+ // remove from list & delete LRU from map
+ Node* lru = left->next;
+ remove(lru);
+ cache.erase(lru->k);
+
+ // Free allocated memory for the removed node
+ delete lru;
+ }
+ }
+private:
+ int cap;
+ unordered_map cache; // {key -> node}
+ Node* left;
+ Node* right;
+
+ // remove node from list
+ void remove(Node* node) {
+ Node* prev = node->prev;
+ Node* next = node->next;
+
+ prev->next = next;
+ next->prev = prev;
+ }
+
+ // insert node at right
+ void insert(Node* node) {
+ Node* prev = right->prev;
+ Node* next = right;
+
+ prev->next = node;
+ next->prev = node;
+
+ node->prev = prev;
+ node->next = next;
+ }
+};
+
+/**
+ * Your LRUCache object will be instantiated and called as such:
+ * LRUCache* obj = new LRUCache(capacity);
+ * int param_1 = obj->get(key);
+ * obj->put(key,value);
+ */
diff --git a/out/production/leetcode_Contribution/cpp/15-3sum.cpp b/out/production/leetcode_Contribution/cpp/15-3sum.cpp
new file mode 100644
index 000000000..654a8b07c
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/15-3sum.cpp
@@ -0,0 +1,59 @@
+/*
+ Given int array, return all unique triplets that sum to 0
+ Ex. nums = [-1,0,1,2,-1,-4] -> [[-1,-1,2],[-1,0,1]]
+
+ Sort, for each i, have j & k go outside in, check for 0 sums
+
+ Time: O(n^2)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ vector> threeSum(vector& nums) {
+ vector> result;
+
+ int n = nums.size();
+ if (n < 3) {
+ return result;
+ }
+
+ sort(nums.begin(), nums.end());
+
+ for (int i = 0; i < n - 2; i++) {
+ if (nums[i] > 0) {
+ break;
+ }
+ if (i > 0 && nums[i - 1] == nums[i]) {
+ continue;
+ }
+
+ int j = i + 1;
+ int k = n - 1;
+
+ while (j < k) {
+ int sum = nums[i] + nums[j] + nums[k];
+
+ if (sum < 0) {
+ j++;
+ } else if (sum > 0) {
+ k--;
+ } else {
+ result.push_back({nums[i], nums[j], nums[k]});
+
+ while (j < k && nums[j] == nums[j + 1]) {
+ j++;
+ }
+ j++;
+
+ while (j < k && nums[k - 1] == nums[k]) {
+ k--;
+ }
+ k--;
+ }
+ }
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/150-Evaluate-Reverse-Polish-Notation.cpp b/out/production/leetcode_Contribution/cpp/150-Evaluate-Reverse-Polish-Notation.cpp
new file mode 100644
index 000000000..5f86685df
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/150-Evaluate-Reverse-Polish-Notation.cpp
@@ -0,0 +1,43 @@
+/*
+ Evaluate RPN, valid operators: +, -, *, /
+
+ Stack, if num push, if operator apply to top 2 nums
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ int evalRPN(vector& tokens) {
+ stack stk;
+
+ for (int i = 0; i < tokens.size(); i++) {
+ string token = tokens[i];
+
+ if (token.size() > 1 || isdigit(token[0])) {
+ stk.push(stoi(token));
+ continue;
+ }
+
+ int num2 = stk.top();
+ stk.pop();
+ int num1 = stk.top();
+ stk.pop();
+
+ int result = 0;
+ if (token == "+") {
+ result = num1 + num2;
+ } else if (token == "-") {
+ result = num1 - num2;
+ } else if (token == "*") {
+ result = num1 * num2;
+ } else {
+ result = num1 / num2;
+ }
+ stk.push(result);
+ }
+
+ return stk.top();
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1512-Number-Of-Good-Pairs.cpp b/out/production/leetcode_Contribution/cpp/1512-Number-Of-Good-Pairs.cpp
new file mode 100644
index 000000000..f3b408c8c
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1512-Number-Of-Good-Pairs.cpp
@@ -0,0 +1,20 @@
+class Solution {
+ unordered_map Memo = {};
+ int numIdenticalPairs(vector & nums){
+ unordered_map Memo;
+ int i, k;
+ int NGood;
+ NGood = 0;
+ Memo = {};
+ for(int & i : nums){
+ if(Memo.find(i) == Memo.end()){
+ Memo.insert(make_pair(i, 1));
+ }
+ else{
+ NGood = NGood + Memo[i];
+ Memo[i]++;
+ }
+ }
+ return NGood;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/152-Maximum-Product-Subarray.cpp b/out/production/leetcode_Contribution/cpp/152-Maximum-Product-Subarray.cpp
new file mode 100644
index 000000000..b6bf43bc3
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/152-Maximum-Product-Subarray.cpp
@@ -0,0 +1,19 @@
+class Solution {
+public:
+ int maxProduct(vector& nums) {
+ int res = nums[0];
+ int curMin = 1, curMax = 1;
+
+ for(int i = 0; i < nums.size(); i++)
+ {
+ int n = nums[i];
+
+ int tmp = curMax * n;
+ curMax = max(max(n * curMax, n * curMin), n);
+ curMin = min(min(tmp, n * curMin), n);
+ res = max(res, curMax);
+ }
+
+ return res;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/153-Find-Minimum-In-Rotated-Sorted-Array.cpp b/out/production/leetcode_Contribution/cpp/153-Find-Minimum-In-Rotated-Sorted-Array.cpp
new file mode 100644
index 000000000..2dcc17554
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/153-Find-Minimum-In-Rotated-Sorted-Array.cpp
@@ -0,0 +1,41 @@
+/*
+ * @lc app=leetcode id=153 lang=cpp
+ *
+ * [153] Find Minimum in Rotated Sorted Array
+ */
+
+// @lc code=start
+class Solution
+{
+public:
+ int findMin(vector &nums)
+ {
+ // Neetcode solution Ologn time O1 space binary search
+ int res = nums[0];
+ int l = 0;
+ int r = nums.size() - 1;
+
+ while (l <= r)
+ {
+ if (nums[l] < nums[r])
+ {
+ res = min(res, nums[l]);
+ break;
+ }
+ int mid = l + (r - l) / 2;
+ res = min(res, nums[mid]);
+
+ if (nums[mid] >= nums[l]) // mid present in left sorted array
+ {
+ l = mid + 1; // try to move closer to right sorted array
+ }
+ else
+ {
+ r = mid - 1;
+ }
+ }
+
+ return res;
+ }
+};
+// @lc code=end
diff --git a/out/production/leetcode_Contribution/cpp/155-Min-Stack.cpp b/out/production/leetcode_Contribution/cpp/155-Min-Stack.cpp
new file mode 100644
index 000000000..dfe073550
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/155-Min-Stack.cpp
@@ -0,0 +1,55 @@
+/*
+ Design stack that supports push, pop, top, & retriving min element
+
+ 2 stacks, 1 normal & 1 monotonic decr, only push if lower than top
+
+ Time: O(1)
+ Space: O(n)
+*/
+
+class MinStack {
+public:
+ MinStack() {
+
+ }
+
+ void push(int val) {
+ stk.push(val);
+
+ if (minStk.empty() || val < minStk.top().first) {
+ minStk.push({val, 1});
+ } else if (val == minStk.top().first) {
+ minStk.top().second++;
+ }
+ }
+
+ void pop() {
+ if (stk.top() == minStk.top().first) {
+ minStk.top().second--;
+ if (minStk.top().second == 0) {
+ minStk.pop();
+ }
+ }
+ stk.pop();
+ }
+
+ int top() {
+ return stk.top();
+ }
+
+ int getMin() {
+ return minStk.top().first;
+ }
+private:
+ stack stk;
+ stack> minStk;
+};
+
+/**
+ * Your MinStack object will be instantiated and called as such:
+ * MinStack* obj = new MinStack();
+ * obj->push(val);
+ * obj->pop();
+ * int param_3 = obj->top();
+ * int param_4 = obj->getMin();
+ */
diff --git a/out/production/leetcode_Contribution/cpp/1584-Min-Cost-To-Connect-All-Points.cpp b/out/production/leetcode_Contribution/cpp/1584-Min-Cost-To-Connect-All-Points.cpp
new file mode 100644
index 000000000..7beb444fb
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1584-Min-Cost-To-Connect-All-Points.cpp
@@ -0,0 +1,54 @@
+/*
+ Given array of points, return min cost to connect all points
+ All points have 1 path b/w them, cost is Manhattan distance
+
+ MST problem, Prim's, greedily pick node not in MST & has smallest edge cost
+ Add to MST, & for all its neighbors, try to update min dist values, repeat
+
+ Time: O(n^2)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ int minCostConnectPoints(vector>& points) {
+ int n = points.size();
+
+ int edgesUsed = 0;
+ // track visited nodes
+ vector inMST(n);
+ vector minDist(n, INT_MAX);
+ minDist[0] = 0;
+
+ int result = 0;
+
+ while (edgesUsed < n) {
+ int currMinEdge = INT_MAX;
+ int currNode = -1;
+
+ // greedily pick lowest cost node not in MST
+ for (int i = 0; i < n; i++) {
+ if (!inMST[i] && currMinEdge > minDist[i]) {
+ currMinEdge = minDist[i];
+ currNode = i;
+ }
+ }
+
+ result += currMinEdge;
+ edgesUsed++;
+ inMST[currNode] = true;
+
+ // update adj nodes of curr node
+ for (int i = 0; i < n; i++) {
+ int cost = abs(points[currNode][0] - points[i][0])
+ + abs(points[currNode][1] - points[i][1]);
+
+ if (!inMST[i] && minDist[i] > cost) {
+ minDist[i] = cost;
+ }
+ }
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1641-Count-Sorted-Vowel-Strings.cpp b/out/production/leetcode_Contribution/cpp/1641-Count-Sorted-Vowel-Strings.cpp
new file mode 100644
index 000000000..db528956a
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1641-Count-Sorted-Vowel-Strings.cpp
@@ -0,0 +1,23 @@
+class Solution{
+ public:
+ int countVowelStrings(int n){
+ int An, En, In, On, Un;
+ int An1, En1, On1, In1, Un1;
+ int i;
+ An1 = En1 = In1 = On1 = Un1 = 1;
+ i = 1;
+ while(i < n){
+ An = An1 + En1 + On1 + In1 + Un1;
+ En = En1 + On1 + In1 + Un1;
+ In = In1 + On1 + Un1;
+ On = On1 + Un1;
+ Un = Un1;
+ An1 = An;
+ En1 = En;
+ On1 = On;
+ In1 = In;
+ i++;
+ }
+ return An1 + En1 + In1 + On1 + Un1;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/167-Two-Sum-II.cpp b/out/production/leetcode_Contribution/cpp/167-Two-Sum-II.cpp
new file mode 100644
index 000000000..10992b30d
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/167-Two-Sum-II.cpp
@@ -0,0 +1,34 @@
+/*
+ Given a 1-indexed sorted int array & target:
+ Return indices (added by 1) of 2 nums that add to target
+
+ 2 pointers, outside in, iterate i/j if sum is too low/high
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ vector twoSum(vector& numbers, int target) {
+ int i = 0;
+ int j = numbers.size() - 1;
+
+ vector result;
+
+ while (i < j) {
+ int sum = numbers[i] + numbers[j];
+ if (sum < target) {
+ i++;
+ } else if (sum > target) {
+ j--;
+ } else {
+ result.push_back(i + 1);
+ result.push_back(j + 1);
+ break;
+ }
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/169-Majority-Element.cpp b/out/production/leetcode_Contribution/cpp/169-Majority-Element.cpp
new file mode 100644
index 000000000..5af73c6a0
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/169-Majority-Element.cpp
@@ -0,0 +1,18 @@
+/*
+Given an array nums of size n, return the majority element.
+
+The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.
+*/
+
+class Solution {
+public:
+ int majorityElement(vector& nums) {
+ mapmp;
+ int n=nums.size();
+ for(auto &i:nums){
+ if(++mp[i]>n/2)
+ return i;
+ }
+ return -1;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/17-Letter-Combinations-Phone-Number.cpp b/out/production/leetcode_Contribution/cpp/17-Letter-Combinations-Phone-Number.cpp
new file mode 100644
index 000000000..e2e87dcf5
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/17-Letter-Combinations-Phone-Number.cpp
@@ -0,0 +1,47 @@
+/*
+ Given cell phone pad, return all possible letter combos that the number could represent
+ Ex. digits = "23" -> ["ad","ae","af","bd","be","bf","cd","ce","cf"]
+
+ Hash map all digits to letters, add 1 letter at a time for each digit, then backtrack undo
+
+ Time: O(n x 4^n)
+ Space: O(n x 4^n)
+*/
+
+class Solution {
+public:
+ vector letterCombinations(string digits) {
+ if (digits.empty()) {
+ return {};
+ }
+
+ unordered_map m = {
+ {'2', "abc"},
+ {'3', "def"},
+ {'4', "ghi"},
+ {'5', "jkl"},
+ {'6', "mno"},
+ {'7', "pqrs"},
+ {'8', "tuv"},
+ {'9', "wxyz"}
+ };
+ string curr = "";
+ vector result;
+
+ dfs(digits, 0, m, curr, result);
+ return result;
+ }
+private:
+ void dfs(string digits, int index, unordered_map& m, string& curr, vector& result) {
+ if (index == digits.size()) {
+ result.push_back(curr);
+ return;
+ }
+ string str = m[digits[index]];
+ for (int i = 0; i < str.size(); i++) {
+ curr.push_back(str[i]);
+ dfs(digits, index + 1, m, curr, result);
+ curr.pop_back();
+ }
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1851-Minimum-Interval-To-Include-Each-Query.cpp b/out/production/leetcode_Contribution/cpp/1851-Minimum-Interval-To-Include-Each-Query.cpp
new file mode 100644
index 000000000..1ef415eda
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1851-Minimum-Interval-To-Include-Each-Query.cpp
@@ -0,0 +1,54 @@
+/*
+ Given intervals array & queries array, ans to a query is min interval containing it
+ Ex. intervals = [[1,4],[2,4],[3,6],[4,4]], queries = [2,3,4,5] -> [3,3,1,4]
+
+ Min heap & sort by size of intervals, top will be min size,
+
+ Time: O(n log n + q log q) -> n = number of intervals, q = number of queries
+ Space: O(n + q)
+*/
+
+class Solution {
+public:
+ vector minInterval(vector>& intervals, vector& queries) {
+ vector sortedQueries = queries;
+
+ // [size of interval, end of interval]
+ priority_queue, vector>, greater>> pq;
+ // {query -> size of interval}
+ unordered_map m;
+
+ // also need only valid intervals so sort by start time & sort queries
+ sort(intervals.begin(), intervals.end());
+ sort(sortedQueries.begin(), sortedQueries.end());
+
+ vector result;
+
+ int i = 0;
+ for (int j = 0; j < sortedQueries.size(); j++) {
+ int query = sortedQueries[j];
+
+ while (i < intervals.size() && intervals[i][0] <= query) {
+ int left = intervals[i][0];
+ int right = intervals[i][1];
+ pq.push({right - left + 1, right});
+ i++;
+ }
+
+ while (!pq.empty() && pq.top().second < query) {
+ pq.pop();
+ }
+
+ if (!pq.empty()) {
+ m[query] = pq.top().first;
+ } else {
+ m[query] = -1;
+ }
+ }
+
+ for (int j = 0; j < queries.size(); j++) {
+ result.push_back(m[queries[j]]);
+ }
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/189-Rotate-Array.cpp b/out/production/leetcode_Contribution/cpp/189-Rotate-Array.cpp
new file mode 100644
index 000000000..5e411d955
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/189-Rotate-Array.cpp
@@ -0,0 +1,23 @@
+/*
+ Given an array, rotate the array to the right by k steps, where k is non-negative.
+ Ex.
+ Input: nums = [1,2,3,4,5,6,7], k = 3
+ Output: [5,6,7,1,2,3,4]
+
+ 1.- To avoid problems with the size of the vector we use the remainder of a division.
+ 2.- Reverse the entire vector.
+ 3.- Reverse the parts you want to obtain the result.
+
+ Time: O(1)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ void rotate(vector& nums, int k) {
+ k %= nums.size();
+ reverse(nums.begin(), nums.end());
+ reverse(nums.begin(), nums.begin() + k);
+ reverse(nums.begin() + k, nums.end());
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1899-Merge-Triplets-To-Form-Target-Triplet.cpp b/out/production/leetcode_Contribution/cpp/1899-Merge-Triplets-To-Form-Target-Triplet.cpp
new file mode 100644
index 000000000..326404d17
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1899-Merge-Triplets-To-Form-Target-Triplet.cpp
@@ -0,0 +1,30 @@
+/*
+ Update: [max(ai,aj), max(bi,bj), max(ci,cj)], return if possible to obtain target
+ Ex. triplets = [[2,5,3],[1,8,4],[1,7,5]] target = [2,7,5] -> true, update 1st/3rd
+
+ Skip all "bad" triplets (can never become target), if match add to "good" set
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ bool mergeTriplets(vector>& triplets, vector& target) {
+ unordered_set s;
+
+ for (int i = 0; i < triplets.size(); i++) {
+ if (triplets[i][0] > target[0] || triplets[i][1] > target[1] || triplets[i][2] > target[2]) {
+ continue;
+ }
+
+ for (int j = 0; j < 3; j++) {
+ if (triplets[i][j] == target[j]) {
+ s.insert(j);
+ }
+ }
+ }
+
+ return s.size() == 3;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/19-Remove-Nth-Node-From-End-Of-List.cpp b/out/production/leetcode_Contribution/cpp/19-Remove-Nth-Node-From-End-Of-List.cpp
new file mode 100644
index 000000000..af139e8e0
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/19-Remove-Nth-Node-From-End-Of-List.cpp
@@ -0,0 +1,48 @@
+/*
+ Given head of a linked list, remove nth node from end of list
+ Ex. head = [1,2,3,4,5], n = 2 -> [1,2,3,5]
+
+ Create 2 pointers "n" apart, iterate until end, will be at nth
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode() : val(0), next(nullptr) {}
+ * ListNode(int x) : val(x), next(nullptr) {}
+ * ListNode(int x, ListNode *next) : val(x), next(next) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* removeNthFromEnd(ListNode* head, int n) {
+ if (head->next == NULL) {
+ return NULL;
+ }
+
+ ListNode* slow = head;
+ ListNode* fast = head;
+
+ while (n > 0) {
+ fast = fast->next;
+ n--;
+ }
+
+ if (fast == NULL) {
+ return head->next;
+ }
+
+ while (fast->next != NULL) {
+ slow = slow->next;
+ fast = fast->next;
+ }
+
+ slow->next = slow->next->next;
+ return head;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/190-Reverse-Bits.cpp b/out/production/leetcode_Contribution/cpp/190-Reverse-Bits.cpp
new file mode 100644
index 000000000..3eb0e05d7
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/190-Reverse-Bits.cpp
@@ -0,0 +1,24 @@
+/*
+ Reverse bits of a given integer
+ Ex. n = 10011100 -> 00111001 = 57
+
+ Shift into result & shift out of n
+
+ Time: O(1)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ uint32_t reverseBits(uint32_t n) {
+ uint32_t result = 0;
+
+ for (int i = 0; i < 32; i++) {
+ result <<= 1;
+ result |= n & 1;
+ n >>= 1;
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/191-Number-Of-1-Bits.cpp b/out/production/leetcode_Contribution/cpp/191-Number-Of-1-Bits.cpp
new file mode 100644
index 000000000..9d91bf039
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/191-Number-Of-1-Bits.cpp
@@ -0,0 +1,27 @@
+/*
+ Return number of '1' bits in an int
+ Ex. n = 00001011 -> 3
+
+ Simply count bit-by-bit & shift it off
+
+ Time: O(1)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ int hammingWeight(uint32_t n) {
+ int bit = 0;
+ int result = 0;
+
+ while (n != 0) {
+ bit = n & 1;
+ if (bit == 1) {
+ result++;
+ }
+ n = n >> 1;
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1920-Build-Array-From-Permutation.cpp b/out/production/leetcode_Contribution/cpp/1920-Build-Array-From-Permutation.cpp
new file mode 100644
index 000000000..a64538c9d
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1920-Build-Array-From-Permutation.cpp
@@ -0,0 +1,10 @@
+class Solution {
+ public:
+ vector buildArray(vector& nums){
+ vector ans;
+ for(int & n : nums){
+ ans.push_back(nums[n]);
+ }
+ return ans;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/1929-Cocatenation-Of-Array.cpp b/out/production/leetcode_Contribution/cpp/1929-Cocatenation-Of-Array.cpp
new file mode 100644
index 000000000..4ae21e9d4
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/1929-Cocatenation-Of-Array.cpp
@@ -0,0 +1,12 @@
+class Solution{
+ public:
+ vector getConcatenation(vector& nums){
+ vector ans;
+ int len;
+ len = nums.size();
+ for(int i = 0; i < 2 * len; i++){
+ ans.push_back(nums[i % len]);
+ }
+ return ans;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/198-House-Robber.cpp b/out/production/leetcode_Contribution/cpp/198-House-Robber.cpp
new file mode 100644
index 000000000..e7c3c9030
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/198-House-Robber.cpp
@@ -0,0 +1,27 @@
+/*
+ Given int array, return max amount can rob (can't rob adjacent houses)
+ Ex. nums = [1,2,3,1] -> 4, rob house 1 then house 3: 1 + 3 = 4
+
+ Recursion w/ memoization -> DP, rob either 2 away + here, or 1 away
+ Recurrence relation: robFrom[i] = max(robFrom[i-2] + nums[i], robFrom[i-1])
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ int rob(vector& nums) {
+ int prev = 0;
+ int curr = 0;
+ int next = 0;
+
+ for (int i = 0; i < nums.size(); i++) {
+ next = max(prev + nums[i], curr);
+ prev = curr;
+ curr = next;
+ }
+
+ return curr;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/199-Binary-Tree-Right-Side-View.cpp b/out/production/leetcode_Contribution/cpp/199-Binary-Tree-Right-Side-View.cpp
new file mode 100644
index 000000000..2b68815ab
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/199-Binary-Tree-Right-Side-View.cpp
@@ -0,0 +1,55 @@
+/*
+ Given root of binary tree, return values that can only be seen from the right side
+
+ BFS traversal, push right first before left, store only first value
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ vector rightSideView(TreeNode* root) {
+ if (root == NULL) {
+ return {};
+ }
+
+ queue q;
+ q.push(root);
+
+ vector result;
+
+ while (!q.empty()) {
+ int count = q.size();
+
+ for (int i = count; i > 0; i--) {
+ TreeNode* node = q.front();
+ q.pop();
+
+ if (i == count) {
+ result.push_back(node->val);
+ }
+
+ if (node->right != NULL) {
+ q.push(node->right);
+ }
+ if (node->left != NULL) {
+ q.push(node->left);
+ }
+ }
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/2-Add-Two-Numbers.cpp b/out/production/leetcode_Contribution/cpp/2-Add-Two-Numbers.cpp
new file mode 100644
index 000000000..4d8e96d34
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/2-Add-Two-Numbers.cpp
@@ -0,0 +1,53 @@
+/*
+ Given 2 linked lists, digits stored in reverse order, add them
+ Ex. l1 = [2,4,3] l2 = [5,6,4] -> [7,0,8] (342 + 465 = 807)
+
+ Sum digit-by-digit + carry, handle if one list becomes null
+
+ Time: O(max(m, n))
+ Space: O(max(m, n))
+*/
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode() : val(0), next(nullptr) {}
+ * ListNode(int x) : val(x), next(nullptr) {}
+ * ListNode(int x, ListNode *next) : val(x), next(next) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
+ ListNode* dummy = new ListNode();
+
+ ListNode* curr = dummy;
+ int carry = 0;
+
+ while (l1 != NULL || l2 != NULL) {
+ int val1 = (l1 != NULL) ? l1->val : 0;
+ int val2 = (l2 != NULL) ? l2->val : 0;
+
+ int sum = val1 + val2 + carry;
+ carry = sum / 10;
+
+ curr->next = new ListNode(sum % 10);
+ curr = curr->next;
+
+ if (l1 != NULL) {
+ l1 = l1->next;
+ }
+ if (l2 != NULL) {
+ l2 = l2->next;
+ }
+ }
+
+ if (carry == 1) {
+ curr->next = new ListNode(1);
+ }
+
+ return dummy->next;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/20-Valid-Parentheses.cpp b/out/production/leetcode_Contribution/cpp/20-Valid-Parentheses.cpp
new file mode 100644
index 000000000..671df220a
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/20-Valid-Parentheses.cpp
@@ -0,0 +1,41 @@
+/*
+ Given s w/ '(, ), {, }, [, ]', determine if valid
+ Ex. s = "()[]{}" -> true, s = "(]" -> false
+
+ Stack of opens, check for matching closes & validity
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ bool isValid(string s) {
+ stack open;
+
+ for (int i = 0; i < s.size(); i++) {
+ if (s[i] == ')' || s[i] == '}' || s[i] == ']') {
+ if (open.empty()) {
+ return false;
+ }
+ if (s[i] == ')' && open.top() != '(') {
+ return false;
+ }
+ if (s[i] == '}' && open.top() != '{') {
+ return false;
+ }
+ if (s[i] == ']' && open.top() != '[') {
+ return false;
+ }
+ open.pop();
+ } else {
+ open.push(s[i]);
+ }
+ }
+
+ if (!open.empty()) {
+ return false;
+ }
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/20-Valid-Parenthesis-String.cpp b/out/production/leetcode_Contribution/cpp/20-Valid-Parenthesis-String.cpp
new file mode 100644
index 000000000..f01fb9c82
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/20-Valid-Parenthesis-String.cpp
@@ -0,0 +1,43 @@
+/*
+ Given s containing '(', ')', or '*', determine if valid
+ Ex. s = "()" -> true, s = "(*)" -> true, s = "(*))" -> true
+
+ Brute force: try both possibilities for each asterisk
+ Optimal: greedy, "balance", track min/max lefts
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ bool checkValidString(string s) {
+ int leftMin = 0;
+ int leftMax = 0;
+
+ for (int i = 0; i < s.size(); i++) {
+ if (s[i] == '(') {
+ leftMin++;
+ leftMax++;
+ } else if (s[i] == ')') {
+ leftMin--;
+ leftMax--;
+ } else {
+ leftMin--;
+ leftMax++;
+ }
+ if (leftMax < 0) {
+ return false;
+ }
+ // ex. s = "(*)("
+ if (leftMin < 0) {
+ leftMin = 0;
+ }
+ }
+
+ if (leftMin == 0) {
+ return true;
+ }
+ return false;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/200-Number-Of-Islands.cpp b/out/production/leetcode_Contribution/cpp/200-Number-Of-Islands.cpp
new file mode 100644
index 000000000..6a1df18ac
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/200-Number-Of-Islands.cpp
@@ -0,0 +1,41 @@
+/*
+ Given grid where '1' is land & '0' is water, return # of islands
+
+ DFS, set visited land to '0' to not visit it again, count islands
+
+ Time: O(m x n)
+ Space: O(m x n)
+*/
+
+class Solution {
+public:
+ int numIslands(vector>& grid) {
+ int m = grid.size();
+ int n = grid[0].size();
+
+ int result = 0;
+
+ for (int i = 0; i < m; i++) {
+ for (int j = 0; j < n; j++) {
+ if (grid[i][j] == '1') {
+ dfs(grid, i, j, m, n);
+ result++;
+ }
+ }
+ }
+
+ return result;
+ }
+private:
+ void dfs(vector>& grid, int i, int j, int m, int n) {
+ if (i < 0 || i >= m || j < 0 || j >= n || grid[i][j] == '0') {
+ return;
+ }
+ grid[i][j] = '0';
+
+ dfs(grid, i - 1, j, m, n);
+ dfs(grid, i + 1, j, m, n);
+ dfs(grid, i, j - 1, m, n);
+ dfs(grid, i, j + 1, m, n);
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/2013-Detect-Squares.cpp b/out/production/leetcode_Contribution/cpp/2013-Detect-Squares.cpp
new file mode 100644
index 000000000..641a9d745
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/2013-Detect-Squares.cpp
@@ -0,0 +1,53 @@
+/*
+ Given stream of points, add new points, return count of squares
+
+ Find diagonals, if exists then forms a square, loop thru all points
+
+ Time: O(1) add O(n^2) count -> n = number of points
+ Space: O(n)
+*/
+
+class DetectSquares {
+public:
+ DetectSquares() {
+
+ }
+
+ void add(vector point) {
+ points[point[0]][point[1]]++;
+ }
+
+ int count(vector point) {
+ int x1 = point[0];
+ int y1 = point[1];
+
+ int result = 0;
+
+ for (auto x = points.begin(); x != points.end(); x++) {
+ unordered_map yPoints = x->second;
+ for (auto y = yPoints.begin(); y != yPoints.end(); y++) {
+ int x3 = x->first;
+ int y3 = y->first;
+
+ // skip points on same x-axis or y-axis
+ if (abs(x3 - x1) == 0 || abs(x3 - x1) != abs(y3 - y1)) {
+ continue;
+ }
+
+ result += points[x3][y3] * points[x1][y3] * points[x3][y1];
+ }
+ }
+
+ return result;
+ }
+private:
+ // {x -> {y -> count}}
+ unordered_map> points;
+};
+
+/**
+ * Your DetectSquares object will be instantiated and called as such:
+ * DetectSquares* obj = new DetectSquares();
+ * obj->add(point);
+ * int param_2 = obj->count(point);
+ */
diff --git a/out/production/leetcode_Contribution/cpp/202-Happy-Number.cpp b/out/production/leetcode_Contribution/cpp/202-Happy-Number.cpp
new file mode 100644
index 000000000..a0c78b1dc
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/202-Happy-Number.cpp
@@ -0,0 +1,39 @@
+/*
+ Given num, replace by sum of squares of its digits
+ Repeat until 1 or endless loop, determine if ends in 1
+ Ex. n = 19 -> true, 1^2 + 9^2 = 82, 8^2 + 2^2 = 68 ... 1
+
+ Detect cycle w/ slow/fast pointer technique
+ If happy will eventually be 1, else pointers will meet
+
+ Time: O(log n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ bool isHappy(int n) {
+ int slow = n;
+ int fast = getNext(n);
+
+ while (slow != fast && fast != 1) {
+ slow = getNext(slow);
+ fast = getNext(getNext(fast));
+ }
+
+ if (fast == 1) {
+ return true;
+ }
+ return false;
+ }
+private:
+ int getNext(int n) {
+ int sum = 0;
+ while (n > 0) {
+ int digit = n % 10;
+ n /= 10;
+ sum += pow(digit, 2);
+ }
+ return sum;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/206-Reverse-Linked-List.cpp b/out/production/leetcode_Contribution/cpp/206-Reverse-Linked-List.cpp
new file mode 100644
index 000000000..1d97dff75
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/206-Reverse-Linked-List.cpp
@@ -0,0 +1,41 @@
+/*
+ Given the head of a singly linked list, reverse list & return
+ Ex. head = [1,2,3,4,5] -> [5,4,3,2,1], head = [1,2] -> [2,1]
+
+ Maintain prev, curr, & next pointers, iterate thru & reverse
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode() : val(0), next(nullptr) {}
+ * ListNode(int x) : val(x), next(nullptr) {}
+ * ListNode(int x, ListNode *next) : val(x), next(next) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* reverseList(ListNode* head) {
+ if (head == NULL || head->next == NULL) {
+ return head;
+ }
+
+ ListNode* prev = NULL;
+ ListNode* curr = head;
+ ListNode* next = curr->next;
+
+ while (curr != NULL) {
+ next = curr->next;
+ curr->next = prev;
+ prev = curr;
+ curr = next;
+ }
+
+ return prev;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/207-Course-Schedule.cpp b/out/production/leetcode_Contribution/cpp/207-Course-Schedule.cpp
new file mode 100644
index 000000000..3df974445
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/207-Course-Schedule.cpp
@@ -0,0 +1,48 @@
+/*
+ Courses & prerequisites, return true if can finish all courses
+ Ex. numCourses = 2, prerequisites = [[1,0]] -> true
+
+ All courses can be completed if there's no cycle (visit already visited)
+
+ Time: O(V + E)
+ Space: O(V + E)
+*/
+
+class Solution {
+public:
+ bool canFinish(int numCourses, vector>& prerequisites) {
+ // map each course to prereq list
+ unordered_map> m;
+ for (int i = 0; i < prerequisites.size(); i++) {
+ m[prerequisites[i][0]].push_back(prerequisites[i][1]);
+ }
+ // all courses along current DFS path
+ unordered_set visited;
+
+ for (int course = 0; course < numCourses; course++) {
+ if (!dfs(course, m, visited)) {
+ return false;
+ }
+ }
+ return true;
+ }
+private:
+ bool dfs(int course, unordered_map>& m, unordered_set& visited) {
+ if (visited.find(course) != visited.end()) {
+ return false;
+ }
+ if (m[course].empty()) {
+ return true;
+ }
+ visited.insert(course);
+ for (int i = 0; i < m[course].size(); i++) {
+ int nextCourse = m[course][i];
+ if (!dfs(nextCourse, m, visited)) {
+ return false;
+ }
+ }
+ m[course].clear();
+ visited.erase(course);
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/208-Implement-Trie-Prefix-Tree.cpp b/out/production/leetcode_Contribution/cpp/208-Implement-Trie-Prefix-Tree.cpp
new file mode 100644
index 000000000..cc8cbefa9
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/208-Implement-Trie-Prefix-Tree.cpp
@@ -0,0 +1,83 @@
+/*
+ Implement trie (store/retrieve keys in dataset of strings)
+
+ Each node contains pointer to next letter & is word flag
+
+ Time: O(n) insert, O(n) search, O(n) startsWith
+ Space: O(n) insert, O(1) search, O(1) startsWith
+*/
+
+class TrieNode {
+public:
+ TrieNode* children[26];
+ bool isWord;
+
+ TrieNode() {
+ for (int i = 0; i < 26; i++) {
+ children[i] = NULL;
+ }
+ isWord = false;
+ }
+};
+
+class Trie {
+public:
+ Trie() {
+ root = new TrieNode();
+ }
+
+ void insert(string word) {
+ TrieNode* node = root;
+ int curr = 0;
+
+ for (int i = 0; i < word.size(); i++) {
+ curr = word[i] - 'a';
+ if (node->children[curr] == NULL) {
+ node->children[curr] = new TrieNode();
+ }
+ node = node->children[curr];
+ }
+
+ node->isWord = true;
+ }
+
+ bool search(string word) {
+ TrieNode* node = root;
+ int curr = 0;
+
+ for (int i = 0; i < word.size(); i++) {
+ curr = word[i] - 'a';
+ if (node->children[curr] == NULL) {
+ return false;
+ }
+ node = node->children[curr];
+ }
+
+ return node->isWord;
+ }
+
+ bool startsWith(string prefix) {
+ TrieNode* node = root;
+ int curr = 0;
+
+ for (int i = 0; i < prefix.size(); i++) {
+ curr = prefix[i] - 'a';
+ if (node->children[curr] == NULL) {
+ return false;
+ }
+ node = node->children[curr];
+ }
+
+ return true;
+ }
+private:
+ TrieNode* root;
+};
+
+/**
+ * Your Trie object will be instantiated and called as such:
+ * Trie* obj = new Trie();
+ * obj->insert(word);
+ * bool param_2 = obj->search(word);
+ * bool param_3 = obj->startsWith(prefix);
+ */
diff --git a/out/production/leetcode_Contribution/cpp/209-Minimum-Size-Subarray-Sum.cpp b/out/production/leetcode_Contribution/cpp/209-Minimum-Size-Subarray-Sum.cpp
new file mode 100644
index 000000000..994074132
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/209-Minimum-Size-Subarray-Sum.cpp
@@ -0,0 +1,37 @@
+/* Given an array of positive integers nums and a positive integer target,
+return the minimal length of a contiguous subarray [numsl, numsl+1, ..., numsr-1, numsr]
+of which the sum is greater than or equal to target.
+If there is no such subarray, return 0 instead.
+Ex.: target = 7, nums = [2,3,1,2,4,3] -> 2
+ target = 4, nums = [1,4,4] -> 1
+Sliding window (with two pointer). Keep adding elements to the SL. When Sum => target or SP points to end of the vector resize the SW. */
+
+class Solution{
+ public:
+ int minSubArrayLen(int target, vector& nums){
+ int min;
+ int fp, sp;
+ int sum;
+ fp = 0;
+ sp = 1;
+ sum = nums[0];
+ min = nums.size() + 1;
+ while(fp != sp){
+ if(Sum >= target){
+ min = min(sp - fp, min);
+ sum = Sìsum - nums[fp];
+ fp++;
+ }
+ else{
+ if(sp < nums.size()){
+ sum = sum + nums[sp];
+ sp++;
+ }
+ else{
+ fp++;
+ }
+ }
+ }
+ return min;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/21-Merge-Two-Sorted-Lists.cpp b/out/production/leetcode_Contribution/cpp/21-Merge-Two-Sorted-Lists.cpp
new file mode 100644
index 000000000..febb22345
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/21-Merge-Two-Sorted-Lists.cpp
@@ -0,0 +1,63 @@
+/*
+ Given heads of 2 sorted linked lists, merge into 1 sorted list
+ Ex. list1 = [1,2,4], list2 = [1,3,4] -> [1,1,2,3,4,4]
+
+ Create curr pointer, iterate thru, choose next to be lower one
+
+ Time: O(m + n)
+ Space: O(1)
+*/
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode() : val(0), next(nullptr) {}
+ * ListNode(int x) : val(x), next(nullptr) {}
+ * ListNode(int x, ListNode *next) : val(x), next(next) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
+ if (list1 == NULL && list2 == NULL) {
+ return NULL;
+ }
+ if (list1 == NULL) {
+ return list2;
+ }
+ if (list2 == NULL) {
+ return list1;
+ }
+
+ ListNode* head = NULL;
+ if (list1->val <= list2->val) {
+ head = list1;
+ list1 = list1->next;
+ } else {
+ head = list2;
+ list2 = list2->next;
+ }
+ ListNode* curr = head;
+
+ while (list1 != NULL && list2 != NULL) {
+ if (list1->val <= list2->val) {
+ curr->next = list1;
+ list1 = list1->next;
+ } else {
+ curr->next = list2;
+ list2 = list2->next;
+ }
+ curr = curr->next;
+ }
+
+ if (list1 == NULL) {
+ curr->next = list2;
+ } else {
+ curr->next = list1;
+ }
+
+ return head;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/210-Course-Schedule-II.cpp b/out/production/leetcode_Contribution/cpp/210-Course-Schedule-II.cpp
new file mode 100644
index 000000000..763d68a08
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/210-Course-Schedule-II.cpp
@@ -0,0 +1,56 @@
+/*
+ Courses & prerequisites, return ordering of courses to take to finish all courses
+ Ex. numCourses = 2, prerequisites = [[1,0]] -> [0,1], take course 0 then 1
+
+ All courses can be completed if there's no cycle, check for cycles
+
+ Time: O(V + E)
+ Space: O(V + E)
+*/
+
+class Solution {
+public:
+ vector findOrder(int numCourses, vector>& prerequisites) {
+ unordered_map> m;
+ // build adjacency list of prereqs
+ for (int i = 0; i < prerequisites.size(); i++) {
+ m[prerequisites[i][0]].push_back(prerequisites[i][1]);
+ }
+ unordered_set visit;
+ unordered_set cycle;
+
+ vector result;
+ for (int course = 0; course < numCourses; course++) {
+ if (!dfs(course, m, visit, cycle, result)) {
+ return {};
+ }
+ }
+ return result;
+ }
+private:
+ // a course has 3 possible states:
+ // visited -> course added to result
+ // visiting -> course not added to result, but added to cycle
+ // unvisited -> course not added to result or cycle
+ bool dfs(int course, unordered_map>& m, unordered_set& visit,
+ unordered_set& cycle, vector& result) {
+
+ if (cycle.find(course) != cycle.end()) {
+ return false;
+ }
+ if (visit.find(course) != visit.end()) {
+ return true;
+ }
+ cycle.insert(course);
+ for (int i = 0; i < m[course].size(); i++) {
+ int nextCourse = m[course][i];
+ if (!dfs(nextCourse, m, visit, cycle, result)) {
+ return false;
+ }
+ }
+ cycle.erase(course);
+ visit.insert(course);
+ result.push_back(course);
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/211-Design-Add-And-Search-Words-Data-Structure.cpp b/out/production/leetcode_Contribution/cpp/211-Design-Add-And-Search-Words-Data-Structure.cpp
new file mode 100644
index 000000000..71a1d4def
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/211-Design-Add-And-Search-Words-Data-Structure.cpp
@@ -0,0 +1,75 @@
+/*
+ Design add & search words data structure
+
+ Implement trie, handle wildcards: traverse all children & search substrings
+
+ Time: O(m x 26^n) -> m = # of words, n = length of words
+ Space: O(n)
+*/
+
+class TrieNode {
+public:
+ TrieNode* children[26];
+ bool isWord;
+
+ TrieNode() {
+ for (int i = 0; i < 26; i++) {
+ children[i] = NULL;
+ }
+ isWord = false;
+ }
+};
+
+class WordDictionary {
+public:
+ WordDictionary() {
+ root = new TrieNode();
+ }
+
+ void addWord(string word) {
+ TrieNode* node = root;
+ int curr = 0;
+
+ for (int i = 0; i < word.size(); i++) {
+ curr = word[i] - 'a';
+ if (node->children[curr] == NULL) {
+ node->children[curr] = new TrieNode();
+ }
+ node = node->children[curr];
+ }
+
+ node->isWord = true;
+ }
+
+ bool search(string word) {
+ TrieNode* node = root;
+ return searchInNode(word, 0, node);
+ }
+private:
+ TrieNode* root;
+
+ bool searchInNode(string& word, int i, TrieNode* node) {
+ if (node == NULL) {
+ return false;
+ }
+ if (i == word.size()) {
+ return node->isWord;
+ }
+ if (word[i] != '.') {
+ return searchInNode(word, i + 1, node->children[word[i] - 'a']);
+ }
+ for (int j = 0; j < 26; j++) {
+ if (searchInNode(word, i + 1, node->children[j])) {
+ return true;
+ }
+ }
+ return false;
+ }
+};
+
+/**
+ * Your WordDictionary object will be instantiated and called as such:
+ * WordDictionary* obj = new WordDictionary();
+ * obj->addWord(word);
+ * bool param_2 = obj->search(word);
+ */
diff --git a/out/production/leetcode_Contribution/cpp/212-Word-Search-II.cpp b/out/production/leetcode_Contribution/cpp/212-Word-Search-II.cpp
new file mode 100644
index 000000000..1c23850c5
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/212-Word-Search-II.cpp
@@ -0,0 +1,89 @@
+/*
+ Given a board of characters & a list of words, return all words on the board
+
+ Implement trie, for search: iterate thru children until isWord, add to result
+
+ Time: O(m x (4 x 3^(l - 1))) -> m = # of cells, l = max length of words
+ Space: O(n) -> n = total number of letters in dictionary (no overlap in Trie)
+*/
+
+class TrieNode {
+public:
+ TrieNode* children[26];
+ bool isWord;
+
+ TrieNode() {
+ for (int i = 0; i < 26; i++) {
+ children[i] = NULL;
+ }
+ isWord = false;
+ }
+};
+
+class Solution {
+public:
+ vector findWords(vector>& board, vector& words) {
+ for (int i = 0; i < words.size(); i++) {
+ insert(words[i]);
+ }
+
+ int m = board.size();
+ int n = board[0].size();
+
+ TrieNode* node = root;
+ vector result;
+
+ for (int i = 0; i < m; i++) {
+ for (int j = 0; j < n; j++) {
+ search(board, i, j, m, n, node, "", result);
+ }
+ }
+
+ return result;
+ }
+private:
+ TrieNode* root = new TrieNode();
+
+ void insert(string word) {
+ TrieNode* node = root;
+ int curr = 0;
+
+ for (int i = 0; i < word.size(); i++) {
+ curr = word[i] - 'a';
+ if (node->children[curr] == NULL) {
+ node->children[curr] = new TrieNode();
+ }
+ node = node->children[curr];
+ }
+
+ node->isWord = true;
+ }
+
+ void search(vector>& board, int i, int j, int m, int n, TrieNode* node, string word, vector& result) {
+ if (i < 0 || i >= m || j < 0 || j >= n || board[i][j] == '#') {
+ return;
+ }
+
+ char c = board[i][j];
+
+ node = node->children[c - 'a'];
+ if (node == NULL) {
+ return;
+ }
+
+ word += board[i][j];
+ if (node->isWord) {
+ result.push_back(word);
+ node->isWord = false;
+ }
+
+ board[i][j] = '#';
+
+ search(board, i - 1, j, m, n, node, word, result);
+ search(board, i + 1, j, m, n, node, word, result);
+ search(board, i, j - 1, m, n, node, word, result);
+ search(board, i, j + 1, m, n, node, word, result);
+
+ board[i][j] = c;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/213-House-Robber-II.cpp b/out/production/leetcode_Contribution/cpp/213-House-Robber-II.cpp
new file mode 100644
index 000000000..33998c157
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/213-House-Robber-II.cpp
@@ -0,0 +1,40 @@
+/*
+ Given int array in a circle, return max amount can rob (can't rob adj houses)
+ Ex. nums = [2,3,2] -> 3, can't rob house 1 & 3 b/c circular adj, so rob 2
+
+ Recursion w/ memo -> DP, rob either 2 away + here, or 1 away, try both ranges
+ Recurrence relation: robFrom[i] = max(robFrom[i-2] + nums[i], robFrom[i-1])
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ int rob(vector& nums) {
+ int n = nums.size();
+
+ if (n == 1) {
+ return nums[0];
+ }
+
+ int range1 = robber(nums, 0, n - 2);
+ int range2 = robber(nums, 1, n - 1);
+
+ return max(range1, range2);
+ }
+private:
+ int robber(vector& nums, int start, int end) {
+ int prev = 0;
+ int curr = 0;
+ int next = 0;
+
+ for (int i = start; i <= end; i++) {
+ next = max(prev + nums[i], curr);
+ prev = curr;
+ curr = next;
+ }
+
+ return curr;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/215-Kth-Largest-Element-In-Array.cpp b/out/production/leetcode_Contribution/cpp/215-Kth-Largest-Element-In-Array.cpp
new file mode 100644
index 000000000..cce145d8e
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/215-Kth-Largest-Element-In-Array.cpp
@@ -0,0 +1,67 @@
+/*
+ Given array and int k, return kth largest element in array
+ Ex. nums = [3,2,1,5,6,4], k = 2 -> 5
+
+ Quickselect, partition until pivot = k, left side all > k
+
+ Time: O(n) -> optimized from O(n log k) min heap solution
+ Space: O(1)
+*/
+
+// class Solution {
+// public:
+// int findKthLargest(vector& nums, int k) {
+// priority_queue, greater> pq;
+// for (int i = 0; i < nums.size(); i++) {
+// pq.push(nums[i]);
+// if (pq.size() > k) {
+// pq.pop();
+// }
+// }
+// return pq.top();
+// }
+// };
+
+class Solution {
+public:
+ int findKthLargest(vector& nums, int k) {
+ int low = 0;
+ int high = nums.size() - 1;
+ int pivotIndex = nums.size();
+
+ while (pivotIndex != k - 1) {
+ pivotIndex = partition(nums, low, high);
+ if (pivotIndex < k - 1) {
+ low = pivotIndex + 1;
+ } else {
+ high = pivotIndex - 1;
+ }
+ }
+
+ return nums[k - 1];
+ }
+private:
+ int partition(vector& nums, int low, int high) {
+ int pivot = nums[low];
+
+ int i = low + 1;
+ int j = high;
+
+ while (i <= j) {
+ if (nums[i] < pivot && pivot < nums[j]) {
+ swap(nums[i], nums[j]);
+ i++;
+ j--;
+ }
+ if (nums[i] >= pivot) {
+ i++;
+ }
+ if (pivot >= nums[j]) {
+ j--;
+ }
+ }
+
+ swap(nums[low], nums[j]);
+ return j;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/217-Contains-Duplicate.cpp b/out/production/leetcode_Contribution/cpp/217-Contains-Duplicate.cpp
new file mode 100644
index 000000000..d47474175
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/217-Contains-Duplicate.cpp
@@ -0,0 +1,25 @@
+/*
+ Given int array, return true if any value appears at least twice
+ Ex. nums = [1,2,3,1] -> true, nums = [1,2,3,4] -> false
+
+ If seen num previously then has dupe, else insert into hash set
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ bool containsDuplicate(vector& nums) {
+ unordered_set s;
+
+ for (int i = 0; i < nums.size(); i++) {
+ if (s.find(nums[i]) != s.end()) {
+ return true;
+ }
+ s.insert(nums[i]);
+ }
+
+ return false;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/219-Contains-Duplicate-II.cpp b/out/production/leetcode_Contribution/cpp/219-Contains-Duplicate-II.cpp
new file mode 100644
index 000000000..51dd1e417
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/219-Contains-Duplicate-II.cpp
@@ -0,0 +1,15 @@
+class Solution {
+public:
+ bool containsNearbyDuplicate(vector& nums, int k) {
+ unordered_map number_map;
+ for (int i = 0; i < nums.size(); ++i) {
+ int num = nums[i];
+ if (number_map.find(num) != number_map.end() && i - number_map[num] <= k) {
+ return true;
+ }else {
+ number_map[num] = i;
+ }
+ }
+ return false;
+ }
+};
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/cpp/22-Generate-Parentheses.cpp b/out/production/leetcode_Contribution/cpp/22-Generate-Parentheses.cpp
new file mode 100644
index 000000000..76937481d
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/22-Generate-Parentheses.cpp
@@ -0,0 +1,31 @@
+/*
+ Given n pairs of parentheses, generate all combos of well-formed parentheses
+ Ex. n = 3 -> ["((()))","(()())","(())()","()(())","()()()"], n = 1 -> ["()"]
+
+ Backtracking, keep valid, favor trying opens, then try closes if still valid
+
+ Time: O(2^n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ vector generateParenthesis(int n) {
+ vector result;
+ generate(n, 0, 0, "", result);
+ return result;
+ }
+private:
+ void generate(int n, int open, int close, string str, vector& result) {
+ if (open == n && close == n) {
+ result.push_back(str);
+ return;
+ }
+ if (open < n) {
+ generate(n, open + 1, close, str + '(', result);
+ }
+ if (open > close) {
+ generate(n, open, close + 1, str + ')', result);
+ }
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/2235-Add-Two-Integers.cpp b/out/production/leetcode_Contribution/cpp/2235-Add-Two-Integers.cpp
new file mode 100644
index 000000000..fea0ba5d6
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/2235-Add-Two-Integers.cpp
@@ -0,0 +1,6 @@
+class Solution{
+ public:
+ int sum(int num1, int num2){
+ return num1 + num2;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/225-Implement-Stack-Using-Queues.cpp b/out/production/leetcode_Contribution/cpp/225-Implement-Stack-Using-Queues.cpp
new file mode 100644
index 000000000..b195b6f39
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/225-Implement-Stack-Using-Queues.cpp
@@ -0,0 +1,64 @@
+/*
+Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and empty).
+
+Implement the MyStack class:
+
+void push(int x) Pushes element x to the top of the stack.
+int pop() Removes the element on the top of the stack and returns it.
+int top() Returns the element on the top of the stack.
+boolean empty() Returns true if the stack is empty, false otherwise.
+Notes:
+
+You must use only standard operations of a queue, which means that only push to back, peek/pop from front, size and is empty operations are valid.
+Depending on your language, the queue may not be supported natively. You may simulate a queue using a list or deque (double-ended queue) as long as you use only a queue's standard operations.
+
+*/
+/**
+ * Your MyStack object will be instantiated and called as such:
+ * MyStack* obj = new MyStack();
+ * obj->push(x);
+ * int param_2 = obj->pop();
+ * int param_3 = obj->top();
+ * bool param_4 = obj->empty();
+ */
+class MyStack {
+ queueq1;
+ queueq2;
+public:
+ MyStack() {
+
+ }
+
+ void push(int x) {
+ q1.push(x);
+ }
+
+ int pop() {
+ while(q1.size()!=1){
+ q2.push(q1.front());
+ q1.pop();
+ }
+ int x=q1.front();
+ q1.pop();
+ swap(q1,q2);
+ return x;
+
+ }
+
+ int top() {
+ while(q1.size()!=1){
+ q2.push(q1.front());
+ q1.pop();
+ }
+ int x=q1.front();
+ q1.pop();
+ swap(q1,q2);
+ q1.push(x);
+ return x;
+
+ }
+ bool empty() {
+ return(q1.empty() && q2.empty());
+
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/226-Invert-Binary-Tree.cpp b/out/production/leetcode_Contribution/cpp/226-Invert-Binary-Tree.cpp
new file mode 100644
index 000000000..266b934e8
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/226-Invert-Binary-Tree.cpp
@@ -0,0 +1,33 @@
+/*
+ Given the root of a binary tree, invert the tree, and return its root
+ Ex. root = [4,2,7,1,3,6,9] -> [4,7,2,9,6,3,1], [2,1,3] -> [2,3,1]
+
+ Preorder traversal, at each node, swap it's left and right children
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ TreeNode* invertTree(TreeNode* root) {
+ if (root == NULL) {
+ return NULL;
+ }
+ swap(root->left, root->right);
+ invertTree(root->left);
+ invertTree(root->right);
+ return root;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/23-Merge-K-Sorted-Lists.cpp b/out/production/leetcode_Contribution/cpp/23-Merge-K-Sorted-Lists.cpp
new file mode 100644
index 000000000..26fb63d89
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/23-Merge-K-Sorted-Lists.cpp
@@ -0,0 +1,106 @@
+/*
+ Given array of k sorted linked-lists, merge all into 1 sorted list
+ Ex. lists = [[1,4,5],[1,3,4],[2,6]] -> [1,1,2,3,4,4,5,6]
+
+ Min heap -> optimize space w/ divide-and-conquer, merge 2 each time
+
+ Time: O(n log k)
+ Space: O(n) -> O(1)
+*/
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode() : val(0), next(nullptr) {}
+ * ListNode(int x) : val(x), next(nullptr) {}
+ * ListNode(int x, ListNode *next) : val(x), next(next) {}
+ * };
+ */
+
+// class Solution {
+// public:
+// ListNode* mergeKLists(vector& lists) {
+// priority_queue, greater> pq;
+// for (int i = 0; i < lists.size(); i++) {
+// ListNode* node = lists[i];
+// while (node != NULL) {
+// pq.push(node->val);
+// node = node->next;
+// }
+// }
+// if (pq.empty()) {
+// return NULL;
+// }
+// ListNode* node = new ListNode(pq.top());
+// pq.pop();
+// ListNode* head = node;
+// while (!pq.empty()) {
+// node->next = new ListNode(pq.top());
+// pq.pop();
+// node = node->next;
+// }
+// return head;
+// }
+// };
+
+class Solution {
+public:
+ ListNode* mergeKLists(vector& lists) {
+ int n = lists.size();
+ if (n == 0) {
+ return NULL;
+ }
+
+ while (n > 1) {
+ for (int i = 0; i < n / 2; i++) {
+ lists[i] = mergeTwoLists(lists[i], lists[n - i - 1]);
+ }
+ n = (n + 1) / 2;
+ }
+
+ return lists.front();
+ }
+private:
+ ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
+ if (list1 == NULL && list2 == NULL) {
+ return NULL;
+ }
+ if (list1 == NULL) {
+ return list2;
+ }
+ if (list2 == NULL) {
+ return list1;
+ }
+
+ ListNode* head = NULL;
+ if (list1->val <= list2->val) {
+ head = list1;
+ list1 = list1->next;
+ } else {
+ head = list2;
+ list2 = list2->next;
+ }
+ ListNode* curr = head;
+
+ while (list1 != NULL && list2 != NULL) {
+ if (list1->val <= list2->val) {
+ curr->next = list1;
+ list1 = list1->next;
+ } else {
+ curr->next = list2;
+ list2 = list2->next;
+ }
+ curr = curr->next;
+ }
+
+ if (list1 == NULL) {
+ curr->next = list2;
+ } else {
+ curr->next = list1;
+ }
+
+ return head;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/230-Kth-Smallest-Element-In-A-Bst.cpp b/out/production/leetcode_Contribution/cpp/230-Kth-Smallest-Element-In-A-Bst.cpp
new file mode 100644
index 000000000..1a8f97f3d
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/230-Kth-Smallest-Element-In-A-Bst.cpp
@@ -0,0 +1,42 @@
+/*
+ Given root of BST & int k, return kth smallest value (1-indexed) of all values in tree
+ Ex. root = [3,1,4,null,2] k = 1 -> 1, root = [5,3,6,2,4,null,null,1] k = 3 -> 3
+
+ Inorder traversal, each visit decrement k, when k = 0 return, works because inorder
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+ int kthSmallest(TreeNode* root, int k) {
+ int result = 0;
+ inorder(root, k, result);
+ return result;
+ }
+private:
+ void inorder(TreeNode* root, int& k, int& result) {
+ if (root == NULL) {
+ return;
+ }
+ inorder(root->left, k, result);
+ k--;
+ if (k == 0) {
+ result = root->val;
+ return;
+ }
+ inorder(root->right, k, result);
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/2315-Count-Asterisks.cpp b/out/production/leetcode_Contribution/cpp/2315-Count-Asterisks.cpp
new file mode 100644
index 000000000..577e4f184
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/2315-Count-Asterisks.cpp
@@ -0,0 +1,18 @@
+class Solution{
+ public:
+ int countAsterisks(string s){
+ int NAst;
+ bool Coppia;
+ Coppia = false;
+ NAst = 0;
+ for(char & c : s){
+ if((c == '*') && (Coppia == false)){
+ NAst++;
+ }
+ if(c == '|'){
+ Coppia = !Coppia;
+ }
+ }
+ return NAst;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/234-Palindrome-Linked-List.cpp b/out/production/leetcode_Contribution/cpp/234-Palindrome-Linked-List.cpp
new file mode 100644
index 000000000..27a2a2e5b
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/234-Palindrome-Linked-List.cpp
@@ -0,0 +1,16 @@
+class Solution{
+ public:
+ bool isPalindrome(ListNode* head){
+ vector v;
+ while(head != nullptr){
+ v.push_back(head -> val);
+ head = head -> next;
+ }
+ for(int i = 0; i < v.size() / 2; i++){
+ if(v[i] != v[v.size() - i - 1]){
+ return false;
+ }
+ }
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.cpp b/out/production/leetcode_Contribution/cpp/235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.cpp
new file mode 100644
index 000000000..15883fd1e
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.cpp
@@ -0,0 +1,47 @@
+/*
+ Given a binary search tree (BST), find the LCA of 2 given nodes in the BST
+
+ Use BST property: if curr > left & right go left, else if < go right, else done
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+/**
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ * int val;
+ * TreeNode *left;
+ * TreeNode *right;
+ * TreeNode(int x) : val(x), left(NULL), right(NULL) {}
+ * };
+ */
+
+class Solution {
+public:
+ TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
+ if (p->val < root->val && q->val < root->val) {
+ return lowestCommonAncestor(root->left, p, q);
+ } else if (p->val > root->val && q->val > root->val) {
+ return lowestCommonAncestor(root->right, p, q);
+ } else {
+ return root;
+ }
+ }
+};
+
+// class Solution {
+// public:
+// TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
+// while (root != NULL) {
+// if (p->val < root->val && q->val < root->val) {
+// root = root->left;
+// } else if (p->val > root->val && q->val > root->val) {
+// root = root->right;
+// } else {
+// return root;
+// }
+// }
+// return NULL;
+// }
+// };
diff --git a/out/production/leetcode_Contribution/cpp/236-Power-Of-Three.cpp b/out/production/leetcode_Contribution/cpp/236-Power-Of-Three.cpp
new file mode 100644
index 000000000..f07e6f83a
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/236-Power-Of-Three.cpp
@@ -0,0 +1,15 @@
+class Solution{
+ public:
+ bool isPowerOfThree(int n){
+ if(n <= 0){
+ return false;
+ }
+ while(n > 1){
+ if(n % 3 != 0){
+ return false;
+ }
+ n = n / 3;
+ }
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/238-Product-Of-Array-Except-Self.cpp b/out/production/leetcode_Contribution/cpp/238-Product-Of-Array-Except-Self.cpp
new file mode 100644
index 000000000..4eac22fd1
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/238-Product-Of-Array-Except-Self.cpp
@@ -0,0 +1,32 @@
+/*
+ Given an integer array nums, return an array such that:
+ answer[i] is equal to the product of all elements of nums except nums[i]
+ Ex. nums = [1,2,3,4] -> [24,12,8,6], nums = [-1,1,0,-3,3] -> [0,0,9,0,0]
+
+ Calculate prefix products forward, then postfix backwards in a 2nd pass
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ vector productExceptSelf(vector& nums) {
+ int n = nums.size();
+ vector result(n, 1);
+
+ int prefix = 1;
+ for (int i = 0; i < n; i++) {
+ result[i] = prefix;
+ prefix = prefix * nums[i];
+ }
+
+ int postfix = 1;
+ for (int i = n - 1; i >= 0; i--) {
+ result[i] = result[i] * postfix;
+ postfix = postfix * nums[i];
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/239-Sliding-Window-Maximum.cpp b/out/production/leetcode_Contribution/cpp/239-Sliding-Window-Maximum.cpp
new file mode 100644
index 000000000..2201f51e7
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/239-Sliding-Window-Maximum.cpp
@@ -0,0 +1,39 @@
+/*
+ Given int array & sliding window size k, return max sliding window
+ Ex. nums = [1,3,-1,-3,5,3,6,7] k = 3 -> [3,3,5,5,6,7]
+
+ Sliding window deque, ensure monotonic decr, leftmost largest
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ vector maxSlidingWindow(vector& nums, int k) {
+ deque dq;
+ vector result;
+
+ int i = 0;
+ int j = 0;
+
+ while (j < nums.size()) {
+ while (!dq.empty() && nums[dq.back()] < nums[j]) {
+ dq.pop_back();
+ }
+ dq.push_back(j);
+
+ if (i > dq.front()) {
+ dq.pop_front();
+ }
+
+ if (j + 1 >= k) {
+ result.push_back(nums[dq.front()]);
+ i++;
+ }
+ j++;
+ }
+
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/242-Valid-Anagram-Hashmap.cpp b/out/production/leetcode_Contribution/cpp/242-Valid-Anagram-Hashmap.cpp
new file mode 100644
index 000000000..8acae385b
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/242-Valid-Anagram-Hashmap.cpp
@@ -0,0 +1,21 @@
+// hashmap solution, similar to neetcode python implementation
+
+class Solution {
+public:
+ bool isAnagram(string s, string t) {
+ if(s.size() != t.size()) return false;
+
+ unordered_map smap;
+ unordered_map tmap;
+
+ for(int i = 0; i < s.size(); i++){
+ smap[s[i]]++;
+ tmap[t[i]]++;
+ }
+
+ for(int i = 0; i < smap.size(); i++){
+ if(smap[i] != tmap[i]) return false;
+ }
+ return true;
+ }
+};
\ No newline at end of file
diff --git a/out/production/leetcode_Contribution/cpp/242-Valid-Anagram.cpp b/out/production/leetcode_Contribution/cpp/242-Valid-Anagram.cpp
new file mode 100644
index 000000000..307676a45
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/242-Valid-Anagram.cpp
@@ -0,0 +1,32 @@
+/*
+ Given 2 strings, return true if anagrams (same letters diff order)
+ Ex. s = "anagram" & t = "nagaram" -> true, s = "rat" & t = "car" -> false
+
+ Count chars, strings should have same # of chars if anagram
+
+ Time: O(n)
+ Space: O(26)
+*/
+
+class Solution {
+public:
+ bool isAnagram(string s, string t) {
+ if (s.size() != t.size()) {
+ return false;
+ }
+
+ vector count(26);
+
+ for (int i = 0; i < s.size(); i++) {
+ count[s[i] - 'a']++;
+ }
+
+ for (int j = 0; j < t.size(); j++) {
+ count[t[j] - 'a']--;
+ if (count[t[j] - 'a'] < 0) {
+ return false;
+ }
+ }
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/25-Reverse-Nodes-In-K-Group.cpp b/out/production/leetcode_Contribution/cpp/25-Reverse-Nodes-In-K-Group.cpp
new file mode 100644
index 000000000..6dce22a54
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/25-Reverse-Nodes-In-K-Group.cpp
@@ -0,0 +1,58 @@
+/*
+ Given head of linked list, reverse nodes of list k at a time
+ Ex. head = [1,2,3,4,5], k = 2 -> [2,1,4,3,5]
+
+ Maintain prev, curr, & temp pointers to reverse, count k times
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode() : val(0), next(nullptr) {}
+ * ListNode(int x) : val(x), next(nullptr) {}
+ * ListNode(int x, ListNode *next) : val(x), next(next) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* reverseKGroup(ListNode* head, int k) {
+ ListNode* dummy = new ListNode();
+ dummy->next = head;
+
+ ListNode* prev = dummy;
+ ListNode* curr = dummy->next;
+ ListNode* temp = NULL;
+
+ int count = k;
+
+ while (curr != NULL) {
+ if (count > 1) {
+ temp = prev->next;
+ prev->next = curr->next;
+ curr->next = curr->next->next;
+ prev->next->next = temp;
+
+ count--;
+ } else {
+ prev = curr;
+ curr = curr->next;
+ count = k;
+
+ ListNode* end = curr;
+ for (int i = 0; i < k; i++) {
+ if (end == NULL) {
+ return dummy->next;
+ }
+ end = end->next;
+ }
+ }
+ }
+
+ return dummy->next;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/252-Meeting-Rooms.cpp b/out/production/leetcode_Contribution/cpp/252-Meeting-Rooms.cpp
new file mode 100644
index 000000000..5689ecda6
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/252-Meeting-Rooms.cpp
@@ -0,0 +1,26 @@
+/*
+ Given array of time intervals, determine if can attend all meetings
+ Ex. intervals = [[0,30],[5,10],[15,20]] -> false
+
+ Sort by start time, check adj meetings, if overlap return false
+
+ Time: O(n log n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ bool canAttendMeetings(vector>& intervals) {
+ if (intervals.empty()) {
+ return true;
+ }
+
+ sort(intervals.begin(), intervals.end());
+ for (int i = 0; i < intervals.size() - 1; i++) {
+ if (intervals[i][1] > intervals[i + 1][0]) {
+ return false;
+ }
+ }
+ return true;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/253-Meeting-Rooms-II.cpp b/out/production/leetcode_Contribution/cpp/253-Meeting-Rooms-II.cpp
new file mode 100644
index 000000000..2c073f94a
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/253-Meeting-Rooms-II.cpp
@@ -0,0 +1,32 @@
+/*
+ Given array of time intervals, determine min # of meeting rooms required
+ Ex. intervals = [[0,30],[5,10],[15,20]] -> 2
+
+ Min heap for earliest end times, most overlap will be heap size
+
+ Time: O(n log n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ int minMeetingRooms(vector>& intervals) {
+ // sort intervals by start time
+ sort(intervals.begin(), intervals.end());
+
+ // min heap to track min end time of merged intervals
+ priority_queue, greater> pq;
+ pq.push(intervals[0][1]);
+
+ for (int i = 1; i < intervals.size(); i++) {
+ // compare curr start w/ earliest end time, if no overlap then pop
+ if (intervals[i][0] >= pq.top()) {
+ pq.pop();
+ }
+ // add new room (will replace/be same size if above was true)
+ pq.push(intervals[i][1]);
+ }
+
+ return pq.size();
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/261-Graph-Valid-Tree.cpp b/out/production/leetcode_Contribution/cpp/261-Graph-Valid-Tree.cpp
new file mode 100644
index 000000000..e5beeb304
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/261-Graph-Valid-Tree.cpp
@@ -0,0 +1,49 @@
+/*
+ Graph of nodes, list of edges, determine if edges make valid tree
+ Ex. n = 5, edges = [[0,1],[0,2],[0,3],[1,4]] -> true
+
+ (1) For graph to be a valid tree, must have exactly n - 1 edges
+ (2) If graph fully connected & has n - 1 edges, can't contain cycle
+
+ Time: O(n)
+ Space: O(n)
+*/
+
+class Solution {
+public:
+ bool validTree(int n, vector>& edges) {
+ vector> adj(n);
+ for (int i = 0; i < edges.size(); i++) {
+ vector edge = edges[i];
+ adj[edge[0]].push_back(edge[1]);
+ adj[edge[1]].push_back(edge[0]);
+ }
+
+ vector visited(n);
+ if (hasCycle(adj, visited, -1, 0)) {
+ return false;
+ }
+
+ for (int i = 0; i < visited.size(); i++) {
+ if (!visited[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+private:
+ bool hasCycle(vector>& adj, vector& visited, int parent, int child) {
+ if (visited[child]) {
+ return true;
+ }
+ visited[child] = true;
+ // checking for cycles and connectedness
+ for (int i = 0; i < adj[child].size(); i++) {
+ int curr = adj[child][i];
+ if (curr != parent && hasCycle(adj, visited, child, curr)) {
+ return true;
+ }
+ }
+ return false;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/268-Missing-Number.cpp b/out/production/leetcode_Contribution/cpp/268-Missing-Number.cpp
new file mode 100644
index 000000000..27233453b
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/268-Missing-Number.cpp
@@ -0,0 +1,25 @@
+/*
+ Given array in range [0, n], return missing
+ Ex. nums = [3,0,1] -> 2, nums = [0,1] -> 2
+
+ Use the fact that XOR is its own inverse
+ Ex. [0,1,3,4]
+ Missing = 4^(0^0)^(1^1)^(2^3)^(3^4)
+ = (4^4)^(0^0)^(1^1)^(3^3)^2
+ = 0^0^0^0^2 = 2
+
+ Time: O(n)
+ Space: O(1)
+*/
+
+class Solution {
+public:
+ int missingNumber(vector& nums) {
+ int n = nums.size();
+ int result = n;
+ for (int i = 0; i < n; i++) {
+ result ^= i ^ nums[i];
+ }
+ return result;
+ }
+};
diff --git a/out/production/leetcode_Contribution/cpp/269-Alien-Dictionary.cpp b/out/production/leetcode_Contribution/cpp/269-Alien-Dictionary.cpp
new file mode 100644
index 000000000..cc016214b
--- /dev/null
+++ b/out/production/leetcode_Contribution/cpp/269-Alien-Dictionary.cpp
@@ -0,0 +1,58 @@
+#include
+#include