A curated collection of LeetCode solutions for mastering Data Structures & Algorithms
Built with ❤️ using LeetHub | Track. Solve. Grow.
Each folder is named after the LeetCode problem:
📁 0001-two-sum/
┣ 📄 solution.cpp
┣ 📄 solution.java
┗ 📄 solution.py
Problems are sorted by difficulty and topic (Easy / Medium / Hard).
- 💻 Languages: C++, Java, Python
- 🔁 Sync Tool: LeetHub
- 📚 Platform: LeetCode
# Step 1: Fork this repo
# Step 2: Clone it locally
git clone https://github.com/your-username/Leetcode-for-DSA.git
# Step 3: Add your own solutions following the naming convention
📚 Array - two pinter, hash table
# | No. | Title | Link | Tags | Level |
---|---|---|---|---|---|
1 | 26 | Remove Duplicates from Sorted Array | Array, Two Pointers | Easy | |
2 | 27 | Remove Element | Array, Two Pointers | Easy | |
3 | 88 | Merge Sorted Array | Array, Two Pointers, Sorting | Easy | |
4 | 170 | Two Sum III - Data Structure Design | Array, Hash Table, Two Pointers | Easy | |
5 | 283 | Move Zeroes | Array, Two Pointers | Easy | |
6 | 349 | Intersection of Two Arrays | Array, Hash Table, Two Pointers | Easy | |
7 | 350 | Intersection of Two Arrays II | Array, Hash Table, Two Pointers | Easy | |
8 | 455 | Assign Cookies | Array, Two Pointers, Greedy | Easy | |
9 | 821 | Shortest Distance to a Character | Array, Two Pointers, String | Easy | |
10 | 832 | Flipping an Image | Array, Two Pointers, Matrix | Easy | |
11 | 905 | Sort Array By Parity | Array, Two Pointers, Sorting | Easy | |
12 | 922 | Sort Array By Parity II | Array, Two Pointers, Sorting | Easy | |
13 | 942 | DI String Match | Array, Two Pointers, String | Easy | |
14 | 977 | Squares of a Sorted Array | Array, Two Pointers, Sorting | Easy | |
15 | 1089 | Duplicate Zeros | Array, Two Pointers | Easy | |
16 | 1346 | Check If N and Its Double Exist | Array, Hash Table, Two Pointers | Easy | |
17 | 1385 | Find the Distance Value Between Two Arrays | Array, Two Pointers, Binary Search | Easy | |
18 | 1826 | Faulty Sensor | Array, Two Pointers | Easy | |
19 | 2108 | Find First Palindromic String in the Array | Array, Two Pointers, String | Easy | |
20 | 2367 | Number of Arithmetic Triplets | Array, Hash Table, Two Pointers | Easy | |
21 | 2441 | Largest Positive Integer That Exists With Its Negative | Array, Hash Table, Two Pointers | Easy | |
22 | 2465 | Number of Distinct Averages | Array, Hash Table, Two Pointers | Easy | |
23 | 2511 | Maximum Enemy Forts That Can Be Captured | Array, Two Pointers | Easy | |
24 | 2540 | Minimum Common Value | Array, Hash Table, Two Pointers | Easy | |
25 | 2562 | Find the Array Concatenation Value | Array, Two Pointers, Simulation | Easy | |
26 | 2570 | Merge Two 2D Arrays by Summing Values | Array, Hash Table, Two Pointers | Easy |
📚 Array - Sliding Window
# | No. | Title | Link | Tags | Level |
---|---|---|---|---|---|
1 | 1004 | Max Consecutive Ones III | Array, Sliding Window, Two Pointers | Easy | |
2 | 1343 | Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold | Array, Sliding Window | Easy | |
3 | 1456 | Maximum Number of Vowels in a Substring of Given Length | String, Sliding Window | Easy | |
4 | 1493 | Longest Subarray of 1's After Deleting One Element | Array, Sliding Window, Dynamic Programming | Easy | |
5 | 1652 | Defuse the Bomb | Array, Sliding Window | Easy | |
6 | 1695 | Maximum Erasure Value | Array, Sliding Window, Hash Table | Easy | |
7 | 1984 | Minimum Difference Between Highest and Lowest of K Scores | Array, Sliding Window, Sorting | Easy | |
8 | 2024 | Maximize the Confusion of an Exam | String, Sliding Window, Binary Search | Easy | |
9 | 2270 | Number of Ways to Split Array | Array, Sliding Window, Prefix Sum | Easy |
📘 Array - Two Pointer,Sorting , Binary Search , Greedy
# | No. | Title | LC | Tags | Level |
---|---|---|---|---|---|
1 | 11 | Container With Most Water | Array, Two Pointers, Greedy | Medium | |
2 | 15 | 3Sum | Array, Two Pointers, Sorting | Medium | |
3 | 16 | 3Sum Closest | Array, Two Pointers, Sorting | Medium | |
4 | 18 | 4Sum | Array, Two Pointers, Sorting | Medium | |
5 | 31 | Next Permutation | Array, Two Pointers | Medium | |
6 | 75 | Sort Colors | Array, Two Pointers, Sorting | Medium | |
7 | 80 | Remove Duplicates from Sorted Array II | Array, Two Pointers | Medium | |
8 | 167 | Two Sum II - Input Array Is Sorted | Array, Two Pointers, Binary Search | Medium | |
9 | 189 | Rotate Array | Array, Math, Two Pointers | Medium | |
10 | 244 | Shortest Word Distance II | Array, Hash Table, Two Pointers | Medium | |
11 | 251 | Flatten 2D Vector | Array, Two Pointers, Design | Medium | |
12 | 253 | Meeting Rooms II | Array, Two Pointers, Greedy | Medium | |
13 | 259 | 3Sum Smaller | Array, Two Pointers, Binary Search | Medium | |
14 | 287 | Find the Duplicate Number | Array, Two Pointers, Binary Search | Medium | |
15 | 360 | Sort Transformed Array | Array, Math, Two Pointers | Medium | |
16 | 457 | Circular Array Loop | Array, Hash Table, Two Pointers | Medium | |
17 | 475 | Heaters | Array, Two Pointers, Binary Search | Medium | |
18 | 522 | Longest Uncommon Subsequence II | Array, Hash Table, Two Pointers | Medium | |
19 | 524 | Longest Word in Dictionary through Deleting | Array, Two Pointers, String | Medium | |
20 | 532 | K-diff Pairs in an Array | Array, Hash Table, Two Pointers | Medium | |
21 | 581 | Shortest Unsorted Continuous Subarray | Array, Two Pointers, Stack | Medium | |
22 | 611 | Valid Triangle Number | Array, Two Pointers, Binary Search | Medium | |
23 | 658 | Find K Closest Elements | Array, Two Pointers, Binary Search | Medium | |
24 | 723 | Candy Crush | Array, Two Pointers, Matrix | Medium | |
25 | 795 | Number of Subarrays with Bounded Maximum | Array, Two Pointers | Medium | |
26 | 809 | Expressive Words | Array, Two Pointers, String | Medium | |
27 | 825 | Friends Of Appropriate Ages | Array, Two Pointers, Binary Search | Medium | |
28 | 826 | Most Profit Assigning Work | Array, Two Pointers, Binary Search | Medium | |
29 | 845 | Longest Mountain in Array | Array, Two Pointers | Medium | |
30 | 870 | Advantage Shuffle | Array, Two Pointers, Greedy | Medium | |
31 | 881 | Boats to Save People | Array, Two Pointers, Greedy | Medium | |
32 | 923 | 3Sum With Multiplicity | Array, Hash Table, Two Pointers | Medium | |
33 | 948 | Bag of Tokens | Array, Two Pointers, Greedy | Medium | |
34 | 969 | Pancake Sorting | Array, Two Pointers, Greedy | Medium | |
35 | 986 | Interval List Intersections | Array, Two Pointers | Medium | |
36 | 1040 | Moving Stones Until Consecutive II | Array, Math, Two Pointers | Medium | |
37 | 1048 | Longest String Chain | Array, Hash Table, Two Pointers | Medium | |
38 | 1229 | Meeting Scheduler | Array, Two Pointers, Sorting | Medium | |
39 | 1471 | The k Strongest Values in an Array | Array, Sorting | Medium | |
40 | 1498 | Subsequences Satisfying the Given Sum Condition | Array, Two Pointers, Binary Search | Medium | |
41 | 1508 | Range Sum of Sorted Subarray Sums | Array, Two Pointers, Binary Search | Medium | |
42 | 1570 | Dot Product of Two Sparse Vectors | Array, Hash Table, Two Pointers | Medium | |
43 | 1574 | Shortest Subarray to be Removed to Make Array Sorted | Array, Two Pointers, Binary Search | Medium | |
44 | 1577 | Square Equals Product of Two Numbers | Array, Hash Table, Math | Medium | |
45 | 1679 | Max Number of K-Sum Pairs | Array, Hash Table, Two Pointers | Medium | |
46 | 1712 | Ways to Split Array Into Three Subarrays | Array, Two Pointers, Binary Search | Medium | |
47 | 1813 | Sentence Similarity III | Array, Two Pointers, String | Medium | |
48 | 1855 | Max Distance Between a Pair of Values | Array, Two Pointers, Binary Search | Medium | |
49 | 1861 | Rotating the Box | Array, Two Pointers, Matrix | Medium | |
50 | 1868 | Product of Two Run-Length Encoded Arrays | Array, Two Pointers | Medium | |
51 | 1877 | Minimize Maximum Pair Sum in Array | Array, Two Pointers, Greedy | Medium | |
52 | 2105 | Watering Plants II | Array, Two Pointers, Simulation | Medium | |
53 | 2149 | Rearrange Array Elements by Sign | Array, Two Pointers, Simulation | Medium | |
54 | 2161 | Partition Array According to Given Pivot | Array, Two Pointers, Simulation | Medium | |
55 | 2300 | Successful Pairs of Spells and Potions | Array, Two Pointers, Binary Search | Medium | |
56 | 2332 | Latest Time to Catch a Bus | Array, Two Pointers, Binary Search | Medium | |
57 | 2406 | Divide Intervals Into Min Number of Groups | Array, Two Pointers, Greedy | Medium | |
58 | 2410 | Max Matching of Players With Trainers | Array, Two Pointers, Greedy | Medium | |
59 | 2422 | Merge Operations to Turn Array Into Palindrome | Array, Two Pointers, Greedy | Medium | |
60 | 2462 | Total Cost to Hire K Workers | Array, Two Pointers | Medium | |
61 | 2491 | Divide Players Into Teams of Equal Skill | Array, Hash Table, Two Pointers | Medium | |
62 | 2563 | Count the Number of Fair Pairs | Array, Two Pointers, Binary Search | Medium | |
63 | 2576 | Max Number of Marked Indices | Array, Two Pointers, Binary Search | Medium | |
64 | 2592 | Maximize Greatness of an Array | Array, Two Pointers, Greedy | Medium |
📘 Array - Sliding Window , Binary Search, Hash Table
# | No. | Title | LC Link | Tags | Level |
---|---|---|---|---|---|
1 | 209 | Minimum Size Subarray Sum | Array, Binary Search, Sliding Window | Medium | |
2 | 487 | Max Consecutive Ones II | Array, DP, Sliding Window | Medium | |
3 | 658 | Find K Closest Elements | Array, Two Pointers, Binary Search | Medium | |
4 | 713 | Subarray Product Less Than K | Array, Sliding Window | Medium | |
5 | 718 | Maximum Length of Repeated Subarray | Array, Binary Search | Medium | |
6 | 904 | Fruit Into Baskets | Array, Hash Table, Sliding Window | Medium | |
7 | 930 | Binary Subarrays With Sum | Array, Hash Table, Sliding Window | Medium | |
8 | 978 | Longest Turbulent Subarray | Array, DP, Sliding Window | Medium | |
9 | 1004 | Max Consecutive Ones III | Array, Binary Search, Sliding Window | Medium | |
10 | 1031 | Max Sum of Two Non-Overlapping Subarrays | Array, DP, Sliding Window | Medium | |
11 | 1052 | Grumpy Bookstore Owner | Array, Sliding Window | Medium | |
12 | 1151 | Min Swaps to Group All 1's Together | Array, Sliding Window | Medium | |
13 | 1248 | Count Number of Nice Subarrays | Array, Hash Table, Math | Medium | |
14 | 1343 | Subarrays of Size K with Avg ≥ Threshold | Array, Sliding Window | Medium | |
15 | 1423 | Max Points You Can Obtain from Cards | Array, Sliding Window, Prefix Sum | Medium | |
16 | 1438 | Longest Continuous Subarray Abs Diff ≤ Limit | Array, Queue, Sliding Window | Medium | |
17 | 1477 | Two Non-overlapping Subarrays With Target Sum | Array, Hash Table, Binary Search | Medium | |
18 | 1493 | Longest Subarray of 1's After Deleting One Element | Array, DP, Sliding Window | Medium | |
19 | 1658 | Min Operations to Reduce X to Zero | Array, Hash Table, Binary Search | Medium | |
20 | 1695 | Maximum Erasure Value | Array, Hash Table, Sliding Window | Medium | |
21 | 1696 | Jump Game VI | Array, DP, Queue | Medium | |
22 | 1838 | Frequency of the Most Frequent Element | Array, Binary Search, Greedy | Medium | |
23 | 1852 | Distinct Numbers in Each Subarray | Array, Hash Table, Sliding Window | Medium | |
24 | 1918 | Kth Smallest Subarray Sum | Array, Binary Search, Sliding Window | Medium | |
25 | 2090 | K Radius Subarray Averages | Array, Sliding Window | Medium | |
26 | 2107 | Unique Flavors After Sharing K Candies | Array, Hash Table, Sliding Window | Medium | |
27 | 2134 | Minimum Swaps to Group All 1's Together II | Array, Sliding Window | Medium | |
28 | 2260 | Minimum Consecutive Cards to Pick Up | Array, Hash Table, Sliding Window | Medium | |
29 | 2401 | Longest Nice Subarray | Array, Bit Manipulation, Sliding Window | Medium | |
30 | 2411 | Smallest Subarrays With Max Bitwise OR | Array, Binary Search, Bit Manipulation | Medium | |
31 | 2461 | Maximum Sum of Distinct Subarrays of Length K | Array, Hash Table, Sliding Window | Medium | |
32 | 2537 | Count the Number of Good Subarrays | Array, Hash Table, Sliding Window | Medium | |
33 | 2555 | Maximize Win From Two Segments | Array, Binary Search, Sliding Window | Medium | |
34 | 2653 | Sliding Subarray Beauty | Array, Hash Table, Sliding Window | Medium |
📚 Array - two pointer, Binary Search
- Trapping Rain Water-Array,Two Pointers,3+
- Find K-th Smallest Pair Distance-Array,Two Pointers,Binary Search,1+
- Get the Maximum Score-Array,Two Pointers,2+
- Closest Subsequence Sum,Array,Two Pointers,3+
- Maximum Score of a Good Subarray-Array,Two Pointers,Binary Search,2+
- Partition Array Into Two Arrays to Minimize Sum Difference-Array,Two Pointers,Binary Search,4+
- Maximum Total Beauty of the Gardens-Array,Two Pointers,Binary Search,2+
📚 Array - Sliding Window, Hash Tbale , Binary Search
- Contains Duplicate III-Array,Sliding Window,Sorting,2+
- Sliding Window Maximum-Array,Queue,Sliding Window,2+
- Sliding Window Median-Array,Hash Table,Sliding Window,1+
- Smallest Range Covering Elements from K Lists-Array,Hash Table,Greedy,3+
- K Empty Slots-Array,Binary Indexed Tree,2+
- Shortest Subarray with Sum at Least K-Array,Binary Search,Queue,4+
- Subarrays with K Different Integers-Array,Hash Table,Sliding Window,1+
- Minimum Number of K Consecutive Bit Flips-Array,Bit Manipulation,Queue,2+
- Constrained Subsequence Sum-Array,Dynamic Programming,Queue,3+
- Max Value of Equation-Array,Queue,Sliding Window,2+
- Maximum Number of Visible Points-Array,Math,Geometry,2+
- Minimum Adjacent Swaps for K Consecutive Ones-Array,Greedy,Sliding Window,1+
- Maximum Fruits Harvested After at Most K Steps-Array,Binary Search,Sliding Window,1+
- Count Subarrays With Score Less Than K-Array,Binary Search,Sliding Window,1+
- Maximum Number of Robots Within Budget-Array,Binary Search,Queue,3+
- Count Subarrays With Fixed Bounds-Array,Queue,Sliding Window,1+
- Maximum Frequency Score of a Subarray-Array,Hash Table,Math,1+
- Maximize the Minimum Powered City-Array,Binary Search,Greedy,3+
Trees and Graphs:
https://leetcode.com/problems/tree-of-coprimes/ https://leetcode.com/problems/redundant-connection-ii/ https://leetcode.com/problems/minimum-score-after-removals-on-a-tree/ https://leetcode.com/problems/minimize-malware-spread/ https://leetcode.com/problems/is-graph-bipartite/ https://leetcode.com/problems/jump-game-iii/ https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/ https://leetcode.com/problems/detonate-the-maximum-bombs/ https://leetcode.com/problems/cycle-length-queries-in-a-tree/ https://leetcode.com/problems/count-subtrees-with-max-distance-between-cities/ https://leetcode.com/problems/binary-trees-with-factors/ (with DP) https://leetcode.com/problems/find-eventual-safe-states/ https://leetcode.com/problems/open-the-lock/ https://leetcode.com/problems/surrounded-regions/ https://leetcode.com/problems/minimize-the-total-price-of-the-trips/ https://leetcode.com/problems/create-components-with-same-value/ https://leetcode.com/problems/minimum-cost-to-reach-destination-in-time/ (+DP) https://leetcode.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/ https://leetcode.com/problems/minimum-score-after-removals-on-a-tree/ https://leetcode.com/problems/divide-nodes-into-the-maximum-number-of-groups/ BFS / DFS ( Shortest Paths )
https://leetcode.com/problems/minimum-genetic-mutation/ https://leetcode.com/problems/nearest-exit-from-entrance-in-maze/ https://leetcode.com/problems/shortest-path-in-binary-matrix/ https://leetcode.com/problems/maximum-number-of-points-from-grid-queries/ (with binary search) https://leetcode.com/problems/minimum-time-to-visit-a-cell-in-a-grid/ https://leetcode.com/problems/number-of-restricted-paths-from-first-to-last-node/ (with DP) https://leetcode.com/problems/bus-routes/ Hashmaps
https://leetcode.com/problems/sum-of-matrix-after-queries/ https://leetcode.com/problems/determine-if-two-strings-are-close/ https://leetcode.com/problems/design-movie-rental-system/ Binary Trees
https://leetcode.com/problems/linked-list-in-binary-tree/ https://leetcode.com/problems/step-by-step-directions-from-a-binary-tree-node-to-another/ https://leetcode.com/problems/find-bottom-left-tree-value/ https://leetcode.com/problems/add-one-row-to-tree/ https://leetcode.com/problems/insufficient-nodes-in-root-to-leaf-paths/ https://leetcode.com/problems/path-in-zigzag-labelled-binary-tree/ https://leetcode.com/problems/binary-tree-coloring-game/ https://leetcode.com/problems/number-of-good-leaf-nodes-pairs/ Bitwise Operations :
leetcode.com/problems/neighboring-bitwise-xor/ https://leetcode.com/problems/longest-nice-subarray/ https://leetcode.com/problems/find-kth-largest-xor-coordinate-value/ https://leetcode.com/problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one/ https://leetcode.com/problems/minimum-operations-to-form-subsequence-with-target-sum/ Recursion :
https://leetcode.com/problems/find-the-punishment-number-of-an-integer/ https://leetcode.com/problems/maximum-number-of-achievable-transfer-requests/ https://leetcode.com/problems/split-array-into-fibonacci-sequence/ https://leetcode.com/problems/numbers-with-same-consecutive-differences/ Sliding Window
https://leetcode.com/problems/maximum-sum-of-distinct-subarrays-with-length-k/ https://leetcode.com/problems/max-consecutive-ones-iii/ https://leetcode.com/problems/count-zero-request-servers/ https://leetcode.com/problems/continuous-subarrays/ https://leetcode.com/problems/maximize-the-confusion-of-an-exam/ https://leetcode.com/problems/length-of-the-longest-valid-substring/ Stack
https://leetcode.com/problems/number-of-visible-people-in-a-queue/ https://leetcode.com/problems/robot-collisions/ https://leetcode.com/problems/sum-of-subarray-minimums/ https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/ https://leetcode.com/problems/asteroid-collision/ https://leetcode.com/problems/largest-rectangle-in-histogram/ https://leetcode.com/problems/subarray-with-elements-greater-than-varying-threshold/ https://leetcode.com/problems/apply-operations-to-maximize-score/ https://leetcode.com/problems/beautiful-towers-ii/ Dynamic Programming
https://leetcode.com/problems/count-vowels-permutation/ (A medium level problem) https://leetcode.com/problems/russian-doll-envelopes/ https://leetcode.com/problems/maximum-alternating-subsequence-sum/ https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray/ https://leetcode.com/problems/longest-arithmetic-subsequence/ https://leetcode.com/problems/tallest-billboard/ https://leetcode.com/problems/decremental-string-concatenation/ https://leetcode.com/problems/count-all-possible-routes/ https://leetcode.com/problems/sum-of-imbalance-numbers-of-all-subarrays/ https://leetcode.com/problems/knight-dialer/ https://leetcode.com/problems/longest-arithmetic-subsequence-of-given-difference/ https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended-ii/ https://leetcode.com/problems/number-of-longest-increasing-subsequence/ https://leetcode.com/problems/minimum-sideway-jumps/ https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings/ https://leetcode.com/problems/minimum-difficulty-of-a-job-schedule/ https://leetcode.com/problems/student-attendance-record-ii/ Linked Lists
https://leetcode.com/problems/merge-in-between-linked-lists/ https://leetcode.com/problems/remove-nodes-from-linked-list/ https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list/ https://leetcode.com/problems/split-linked-list-in-parts/ https://leetcode.com/problems/reverse-linked-list-ii/ Bitmasking DP
https://leetcode.com/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps/ https://leetcode.com/problems/maximize-score-after-n-operations/ https://leetcode.com/problems/special-permutations/ https://leetcode.com/problems/minimum-number-of-work-sessions-to-finish-the-tasks/ https://leetcode.com/problems/find-longest-awesome-substring/ https://leetcode.com/problems/number-of-valid-words-for-each-puzzle/ (No DP) https://leetcode.com/problems/number-of-ways-to-wear-different-hats-to-each-other/ https://leetcode.com/problems/the-number-of-good-subsets/ Suffix and Prefix Array :
https://leetcode.com/problems/find-two-non-overlapping-sub-arrays-each-with-target-sum/ (Hashmaps) https://leetcode.com/problems/minimum-deletions-to-make-string-balanced/ https://leetcode.com/problems/minimum-cost-to-make-array-equal/ (with binary search) https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element/ https://leetcode.com/problems/minimum-index-of-a-valid-split/ https://leetcode.com/problems/grid-game/ https://leetcode.com/problems/max-chunks-to-make-sorted-ii/ https://leetcode.com/problems/maximum-fruits-harvested-after-at-most-k-steps/ https://leetcode.com/problems/minimum-penalty-for-a-shop/ https://leetcode.com/problems/132-pattern (with sets) DSU :
https://leetcode.com/problems/accounts-merge/ https://leetcode.com/problems/satisfiability-of-equality-equations/ https://leetcode.com/problems/process-restricted-friend-requests/ https://leetcode.com/problems/graph-connectivity-with-threshold/ https://leetcode.com/problems/making-a-large-island/ Binary Search :
https://leetcode.com/problems/snapshot-array/ https://leetcode.com/problems/range-frequency-queries/ https://leetcode.com/problems/maximum-number-of-removable-characters/ leetcode.com/problems/split-array-largest-sum/ https://leetcode.com/problems/maximize-the-confusion-of-an-exam/ https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/ https://leetcode.com/problems/find-k-th-smallest-pair-distance/ https://leetcode.com/problems/kth-smallest-number-in-multiplication-table/ https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag/ Digit DP
https://leetcode.com/problems/count-of-integers/ https://leetcode.com/problems/non-negative-integers-without-consecutive-ones/ https://leetcode.com/problems/count-stepping-numbers-in-range/ https://leetcode.com/problems/count-special-integers/ Sorting :
https://leetcode.com/problems/movement-of-robots/ (prefix sums) https://leetcode.com/problems/put-marbles-in-bags/ https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/ https://leetcode.com/problems/minimum-interval-to-include-each-query/ https://leetcode.com/problems/non-overlapping-intervals/ https://leetcode.com/problems/k-th-smallest-prime-fraction/ https://leetcode.com/problems/closest-room/ (binary search) String
https://leetcode.com/problems/lexicographically-smallest-string-after-substring-operation/ https://leetcode.com/problems/sum-of-scores-of-built-strings/ (hashing) https://leetcode.com/problems/maximum-repeating-substring/ https://leetcode.com/problems/longest-chunked-palindrome-decomposition/ https://leetcode.com/problems/shortest-palindrome/ https://leetcode.com/problems/maximum-deletions-on-a-string/ https://leetcode.com/problems/longest-duplicate-substring/ Counting
https://leetcode.com/problems/count-unique-characters-of-all-substrings-of-a-given-string/ https://leetcode.com/problems/sum-of-all-odd-length-subarrays/ https://leetcode.com/problems/count-anagrams/ Line Sweep
https://leetcode.com/problems/describe-the-painting/ https://leetcode.com/problems/my-calendar-iii/ https://leetcode.com/problems/number-of-flowers-in-full-bloom/ https://leetcode.com/problems/maximum-beauty-of-an-array-after-applying-operation/ https://leetcode.com/problems/divide-intervals-into-minimum-number-of-groups/ Re-rooting
https://leetcode.com/problems/count-number-of-possible-root-nodes/ https://leetcode.com/problems/difference-between-maximum-and-minimum-price-sum/ https://leetcode.com/problems/minimum-height-trees/ Trie
https://leetcode.com/problems/sum-of-prefix-scores-of-strings/ https://leetcode.com/problems/maximum-genetic-difference-query/ (Tree Query) https://leetcode.com/problems/prefix-and-suffix-search/
✅ Best Practices:
- Keep filenames clean (
solution.cpp
,solution.py
) - Add comments where necessary
- Group problems by topics (optional but encouraged)
Want to help expand this repository?
- Fork it 🍴
- Create your feature branch (
git checkout -b new-solution
) - Commit your changes (
git commit -m 'Added XYZ problem'
) - Push to the branch (
git push origin new-solution
) - Open a PR 🚀
If this project helps you:
- ⭐ Star the repo
- 🔁 Share it with peers preparing for coding interviews
- 🧠 Keep coding and contribute back!
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ☕ and code by Anamicca23
Let’s crack those coding interviews one problem at a time!