A curated collection of LeetCode problems solved with high-performance, low-complexity algorithms, written in C++ and Python.
Each solution is designed to optimize for time complexity, targeting O(1) or O(log n) wherever algorithmically possible.
📈 This repository is more than a solution bank — it's a library of interview-grade, optimized algorithm patterns.
-
✅ Zero/Logarithmic-Time Complexity First: Most solutions are implemented with an emphasis on reducing time complexity to
O(1)/O(log n)where applicable. -
🧩 Clean, Readable Code: Code is written in concise style with meaningful variable names and necessary inline explanations.
-
📂 Organized by Problem ID and Name: All files follow a
ID.Problem-Title.cppor.pynaming convention. -
📌 Tags and Categories: Problems are categorized by type (e.g. Arrays, Graphs, Dynamic Programming).
-
🔁 Auto-synced via LeetHub v2.0: All accepted submissions are pushed directly after successful submission.
/solutions/
├── 1.Two-Sum.cpp
├── 20.Valid-Parentheses.py
├── 53.Maximum-Subarray.cpp
"I do not solve problems to make them go away — I solve them to make them elegant."
For true excellence lies not in mere correctness, but in clarity, grace, and precision. Even though this project has just begun, it is built on a clear philosophy:
Not all accepted answers are equal — only the most refined survive here.
This repository is auto-synced via LeetHub v2.0, but can also be manually extended or cloned.
Suggestions, optimizations, and alternative approaches are welcome via issues or pull requests.
- You're preparing for FAANG / big tech interviews
- You care about algorithm performance and clean code
- You believe
O(1)is better thanO(n)😎
| 0002-add-two-numbers |
| 0010-regular-expression-matching |
| 0021-merge-two-sorted-lists |
| 0024-swap-nodes-in-pairs |
| 0025-reverse-nodes-in-k-group |
| 0044-wildcard-matching |
| 0050-powx-n |
| 0060-permutation-sequence |
| 0003-longest-substring-without-repeating-characters |
| 0030-substring-with-concatenation-of-all-words |
| 0076-minimum-window-substring |
| 0011-container-with-most-water |
| 0044-wildcard-matching |
| 0045-jump-game-ii |
| 0055-jump-game |
| 0122-best-time-to-buy-and-sell-stock-ii |
| 0014-longest-common-prefix |
| 0015-3sum |
| 0016-3sum-closest |
| 0018-4sum |
| 0047-permutations-ii |
| 0049-group-anagrams |
| 0056-merge-intervals |
| 0075-sort-colors |
| 0088-merge-sorted-array |
| 0023-merge-k-sorted-lists |
| 0023-merge-k-sorted-lists |
| 0028-find-the-index-of-the-first-occurrence-in-a-string |
| 0029-divide-two-integers |
| 0067-add-binary |
| 0078-subsets |
| 0089-gray-code |
| 0090-subsets-ii |
| 0042-trapping-rain-water |
| 0084-largest-rectangle-in-histogram |
| 0085-maximal-rectangle |
| 0043-multiply-strings |
| 0054-spiral-matrix |
| 0059-spiral-matrix-ii |
| 0067-add-binary |
| 0068-text-justification |
| 0062-unique-paths |
| 0070-climbing-stairs |
| 0128-longest-consecutive-sequence |
| 0130-surrounded-regions |