https://github.com/kamyu104/leetcode-solutions
ποΈ Python / Modern C++ Solutions of All 4059 LeetCode Problems (Weekly Update)
https://github.com/kamyu104/leetcode-solutions
algorithm algorithms cpp cpp11 data-structure interview-practice interview-preparation interview-questions leetcode leetcode-cpp leetcode-python leetcode-solutions modern-cpp python
Last synced: about 2 months ago
JSON representation
ποΈ Python / Modern C++ Solutions of All 4059 LeetCode Problems (Weekly Update)
- Host: GitHub
- URL: https://github.com/kamyu104/leetcode-solutions
- Owner: kamyu104
- License: mit
- Created: 2018-10-11T17:38:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2026-10-05T17:49:40.000Z (2 months ago)
- Last Synced: 2026-10-06T01:46:42.551Z (2 months ago)
- Topics: algorithm, algorithms, cpp, cpp11, data-structure, interview-practice, interview-preparation, interview-questions, leetcode, leetcode-cpp, leetcode-python, leetcode-solutions, modern-cpp, python
- Language: C++
- Homepage:
- Size: 28.1 MB
- Stars: 5,942
- Watchers: 166
- Forks: 1,801
- Open Issues: 41
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# [LeetCode](https://leetcode.com/problemset/all/)
Β
[](./LICENSE.md)Β
Β
Β
[](https://saythanks.io/to/kamyu104)Β

* R.I.P. to my old Leetcode repository, where there were `5.7k+` stars and `2.2k+` forks (ever the top 3 in the field).
* Since free questions may be even mistakenly taken down by some companies, only solutions will be post on now.
* There are new LeetCode questions every week. I'll keep updating for full summary and better solutions.
* For more problem solutions, you can see my [LintCode](https://github.com/kamyu104/LintCode), [GoogleKickStart](https://github.com/kamyu104/GoogleKickStart-2022), [GoogleCodeJamIO](https://github.com/kamyu104/GoogleCodeJamIO-2022) repositories.
* For more challenging problem solutions, you can also see my [GoogleCodeJam](https://github.com/kamyu104/GoogleCodeJam-Farewell-Rounds), [MetaHackerCup](https://github.com/kamyu104/MetaHackerCup-2025) repositories.
* Hope you enjoy the journey of learning data structures and algorithms.
* Notes: "π" means your subscription of [LeetCode premium membership](https://leetcode.com/subscribe/) is required for reading the question.
## Solutions
- [0001 - 1000](./0001-1000.md)
- [1001 - 2000](./1001-2000.md)
- [2001 - 3000](./2001-3000.md)
- [3001 - Latest](./README.md)
## Algorithms
* [Bit Manipulation](https://github.com/kamyu104/LeetCode-Solutions#bit-manipulation)
* [Array](https://github.com/kamyu104/LeetCode-Solutions#array)
* [String](https://github.com/kamyu104/LeetCode-Solutions#string)
* [Linked List](https://github.com/kamyu104/LeetCode-Solutions#linked-list)
* [Stack](https://github.com/kamyu104/LeetCode-Solutions#stack)
* [Queue](https://github.com/kamyu104/LeetCode-Solutions#queue)
* [Binary Heap](https://github.com/kamyu104/LeetCode-Solutions#binary-heap)
* [Tree](https://github.com/kamyu104/LeetCode-Solutions#tree)
* [Hash Table](https://github.com/kamyu104/LeetCode-Solutions#hash-table)
* [Math](https://github.com/kamyu104/LeetCode-Solutions#math)
* [Sort](https://github.com/kamyu104/LeetCode-Solutions#sort)
* [Two Pointers](https://github.com/kamyu104/LeetCode-Solutions#two-pointers)
* [Recursion](https://github.com/kamyu104/LeetCode-Solutions#recursion)
* [Binary Search](https://github.com/kamyu104/LeetCode-Solutions#binary-search)
* [Binary Search Tree](https://github.com/kamyu104/LeetCode-Solutions#binary-search-tree)
* [Breadth-First Search](https://github.com/kamyu104/LeetCode-Solutions#breadth-first-search)
* [Depth-First Search](https://github.com/kamyu104/LeetCode-Solutions#depth-first-search)
* [Backtracking](https://github.com/kamyu104/LeetCode-Solutions#backtracking)
* [Dynamic Programming](https://github.com/kamyu104/LeetCode-Solutions#dynamic-programming)
* [Greedy](https://github.com/kamyu104/LeetCode-Solutions#greedy)
* [Graph](https://github.com/kamyu104/LeetCode-Solutions#graph)
* [Geometry](https://github.com/kamyu104/LeetCode-Solutions#geometry)
* [Simulation](https://github.com/kamyu104/LeetCode-Solutions#simulation)
* [Constructive Algorithms](https://github.com/kamyu104/LeetCode-Solutions#constructive-algorithms)
* [Design](https://github.com/kamyu104/LeetCode-Solutions#design)
## JavaScript
* [JS](https://github.com/kamyu104/LeetCode-Solutions#js)
## Database
* [SQL](https://github.com/kamyu104/LeetCode-Solutions#sql)
## Pandas
* [PD](https://github.com/kamyu104/LeetCode-Solutions#pd)
## Reference
* [Links](./REFERENCE.md)
## Bit Manipulation
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
3064 | [Guess the Number Using Bitwise Questions I](https://leetcode.com/problems/guess-the-number-using-bitwise-questions-i/) | [C++](./C++/guess-the-number-using-bitwise-questions-i.cpp) [Python](./Python/guess-the-number-using-bitwise-questions-i.py) | _O(logn)_ | _O(1)_ | Medium |π| Bit Manipulation
3094 | [Guess the Number Using Bitwise Questions II](https://leetcode.com/problems/guess-the-number-using-bitwise-questions-ii/) | [C++](./C++/guess-the-number-using-bitwise-questions-ii.cpp) [Python](./Python/guess-the-number-using-bitwise-questions-ii.py) | _O(logr)_ | _O(1)_ | Medium |π| Bit Manipulation
3125 | [Maximum Number That Makes Result of Bitwise AND Zero](https://leetcode.com/problems/maximum-number-that-makes-result-of-bitwise-and-zero/) | [C++](./C++/maximum-number-that-makes-result-of-bitwise-and-zero.cpp) [Python](./Python/maximum-number-that-makes-result-of-bitwise-and-zero.py) | _O(1)_ | _O(1)_ | Medium |π| Bit Manipulation
3133 | [Minimum Array End](https://leetcode.com/problems/minimum-array-end/) | [C++](./C++/minimum-array-end.cpp) [Python](./Python/minimum-array-end.py) | _O(logn)_ | _O(1)_ | Medium | | Bit Manipulation
3199 | [Count Triplets with Even XOR Set Bits I](https://leetcode.com/problems/count-triplets-with-even-xor-set-bits-i/) | [C++](./C++/count-triplets-with-even-xor-set-bits-i.cpp) [Python](./Python/count-triplets-with-even-xor-set-bits-i.py) | _O(nlogr)_ | _O(1)_ | Easy | π | Brute Force, Bit Manipulation, Parity
3215 | [Count Triplets with Even XOR Set Bits II](https://leetcode.com/problems/count-triplets-with-even-xor-set-bits-ii/) | [C++](./C++/count-triplets-with-even-xor-set-bits-ii.cpp) [Python](./Python/count-triplets-with-even-xor-set-bits-ii.py) | _O(nlogr)_ | _O(1)_ | Medium | π | Bit Manipulation, Parity
3226 | [Number of Bit Changes to Make Two Integers Equal](https://leetcode.com/problems/number-of-bit-changes-to-make-two-integers-equal/) | [C++](./C++/number-of-bit-changes-to-make-two-integers-equal.cpp) [Python](./Python/number-of-bit-changes-to-make-two-integers-equal.py) | _O(logn)_ | _O(1)_ | Easy | | Bit Manipulation
3289 | [The Two Sneaky Numbers of Digitville](https://leetcode.com/problems/the-two-sneaky-numbers-of-digitville/) | [C++](./C++/the-two-sneaky-numbers-of-digitville.cpp) [Python](./Python/the-two-sneaky-numbers-of-digitville.py) | _O(n)_ | _O(1)_ | Easy | | Bit Manipulation
3304 | [Find the K-th Character in String Game I](https://leetcode.com/problems/find-the-k-th-character-in-string-game-i/) | [C++](./C++/find-the-k-th-character-in-string-game-i.cpp) [Python](./Python/find-the-k-th-character-in-string-game-i.py) | _O(n)_ | _O(1)_ | Easy | | Bitmasks
3307| [Find the K-th Character in String Game II](https://leetcode.com/problems/find-the-k-th-character-in-string-game-ii/) | [C++](./C++/find-the-k-th-character-in-string-game-ii.cpp) [Python](./Python/find-the-k-th-character-in-string-game-ii.py) | _O(1)_ | _O(1)_ | Hard | | Bitmasks
3314 | [Construct the Minimum Bitwise Array I](https://leetcode.com/problems/construct-the-minimum-bitwise-array-i/) | [C++](./C++/construct-the-minimum-bitwise-array-i.cpp) [Python](./Python/construct-the-minimum-bitwise-array-i.py) | _O(n)_ | _O(1)_ | Easy | | Bit Manipulation
3315 | [Construct the Minimum Bitwise Array II](https://leetcode.com/problems/construct-the-minimum-bitwise-array-ii/) | [C++](./C++/construct-the-minimum-bitwise-array-ii.cpp) [Python](./Python/construct-the-minimum-bitwise-array-ii.py) | _O(n)_ | _O(1)_ | Medium | | Bit Manipulation
3344 | [Maximum Sized Array](https://leetcode.com/problems/maximum-sized-array/) | [C++](./C++/maximum-sized-array.cpp) [Python](./Python/maximum-sized-array.py) | precompute: O(max_s^(1/5) * log(max_s))
runtime: O(log(max_s)) | _O(max_s^(1/5))_ | Medium | π | Precompute, Bitmasks, Combinatorics, Binary Search
3370 | [Smallest Number With All Set Bits](https://leetcode.com/problems/smallest-number-with-all-set-bits/) | [C++](./C++/smallest-number-with-all-set-bits.cpp) [Python](./Python/smallest-number-with-all-set-bits.py) | _O(1)_ | _O(1)_ | Easy | | Bit Manipulation
3566 | [Partition Array into Two Equal Product Subsets](https://leetcode.com/problems/partition-array-into-two-equal-product-subsets/) | [C++](./C++/partition-array-into-two-equal-product-subsets.cpp) [Python](./Python/partition-array-into-two-equal-product-subsets.py) | _O(n * 2^n)_ | _O(1)_ | Medium | | Bitmasks
3632 | [Subarrays with XOR at Least K](https://leetcode.com/problems/subarrays-with-xor-at-least-k/) | [C++](./C++/subarrays-with-xor-at-least-k.cpp) [Python](./Python/subarrays-with-xor-at-least-k.py) | _O(nlogr)_ | _O(t)_ | Hard | π | Bitmasks, Prefix Sum, Trie
3646 | [Next Special Palindrome Number](https://leetcode.com/problems/next-special-palindrome-number/) | [C++](./C++/next-special-palindrome-number.cpp) [Python](./Python/next-special-palindrome-number.py) | precompute: _O(9 * 2^9 + 16 * p + plogp)_
runtime: _O(logp)_ | _O(p)_ | Hard | | Precompute, Bitmasks, Sort, Binary Search
3702 | [Longest Subsequence With Non-Zero Bitwise XOR](https://leetcode.com/problems/longest-subsequence-with-non-zero-bitwise-xor/) | [C++](./C++/longest-subsequence-with-non-zero-bitwise-xor.cpp) [Python](./Python/longest-subsequence-with-non-zero-bitwise-xor.py) | _O(n)_ | _O(1)_ | Medium | | Bitmasks
3750 | [Minimum Number of Flips to Reverse Binary String](https://leetcode.com/problems/minimum-number-of-flips-to-reverse-binary-string/) | [C++](./C++/minimum-number-of-flips-to-reverse-binary-string.cpp) [Python](./Python/minimum-number-of-flips-to-reverse-binary-string.py) | _O(logn)_ | _O(1)_ | Easy | | Bitmasks
3766 | [Minimum Operations to Make Binary Palindrome](https://leetcode.com/problems/minimum-operations-to-make-binary-palindrome/) | [C++](./C++/minimum-operations-to-make-binary-palindrome.cpp) [Python](./Python/minimum-operations-to-make-binary-palindrome.py) | precompute: _O(sqrt(r) * logr)_
runtime: _O(r)_ | _O(r)_ | Medium | | Precompute, Bitmasks, Two Pointers
3769 | [Sort Integers by Binary Reflection](https://leetcode.com/problems/sort-integers-by-binary-reflection/) | [C++](./C++/sort-integers-by-binary-reflection.cpp) [Python](./Python/sort-integers-by-binary-reflection.py) | _O(nlogr + nlogn)_ | _O(n)_ | Easy | | Sort, Bitmasks
3782 | [Last Remaining Integer After Alternating Deletion Operations](https://leetcode.com/problems/last-remaining-integer-after-alternating-deletion-operations/) | [C++](./C++/last-remaining-integer-after-alternating-deletion-operations.cpp) [Python](./Python/last-remaining-integer-after-alternating-deletion-operations.py) | _O(1)_ | _O(1)_ | Hard | | Bitmasks, Simulation
3827 | [Count Monobit Integers](https://leetcode.com/problems/count-monobit-integers/) | [C++](./C++/count-monobit-integers.cpp) [Python](./Python/count-monobit-integers.py) | _O(logn)_ | _O(1)_ | Easy | | Bitmasks
3950 | [Exactly One Consecutive Set Bits Pair](https://leetcode.com/problems/exactly-one-consecutive-set-bits-pair/) | [C++](./C++/exactly-one-consecutive-set-bits-pair.cpp) [Python](./Python/exactly-one-consecutive-set-bits-pair.py) | _O(1)_ | _O(1)_ | Easy | | Bit Manipulation
4005 | [Minimum Operations to Make Array Equal III](https://leetcode.com/problems/minimum-operations-to-make-array-equal-iii/) | [C++](./C++/minimum-operations-to-make-array-equal-iii.cpp) [Python](./Python/minimum-operations-to-make-array-equal-iii.py) | _O(nlogr)_ | _O(n)_ | Hard | π | Freq Table, Bit Manipulation
## Array
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
3009 | [Maximum Number of Intersections on the Chart](https://leetcode.com/problems/maximum-number-of-intersections-on-the-chart/) | [C++](./C++/maximum-number-of-intersections-on-the-chart.cpp) [Python](./Python/maximum-number-of-intersections-on-the-chart.py) | _O(nlogn)_ | _O(n)_ | Hard | π | Sort, Line Sweep, Coordinate Compression
3010 | [Divide an Array Into Subarrays With Minimum Cost I](https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i/) | [C++](./C++/divide-an-array-into-subarrays-with-minimum-cost-i.cpp) [Python](./Python/divide-an-array-into-subarrays-with-minimum-cost-i.py) | _O(n)_ | _O(1)_ | Easy | | Array, Quick Select
3015 | [Count the Number of Houses at a Certain Distance I](https://leetcode.com/problems/count-the-number-of-houses-at-a-certain-distance-i/) | [C++](./C++/count-the-number-of-houses-at-a-certain-distance-i.cpp) [Python](./Python/count-the-number-of-houses-at-a-certain-distance-i.py) | _O(n)_ | _O(n)_ | Medium | | Math, Prefix Sum, Difference Array
3017 | [Count the Number of Houses at a Certain Distance II](https://leetcode.com/problems/count-the-number-of-houses-at-a-certain-distance-ii/) | [C++](./C++/count-the-number-of-houses-at-a-certain-distance-ii.cpp) [Python](./Python/count-the-number-of-houses-at-a-certain-distance-ii.py) | _O(n)_ | _O(1)_ | Hard | | Math, Prefix Sum, Difference Array
3026 | [Maximum Good Subarray Sum](https://leetcode.com/problems/maximum-good-subarray-sum/) | [C++](./C++/maximum-good-subarray-sum.cpp) [Python](./Python/maximum-good-subarray-sum.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum
3028 | [Ant on the Boundary](https://leetcode.com/problems/ant-on-the-boundary/) | [C++](./C++/ant-on-the-boundary.cpp) [Python](./Python/ant-on-the-boundary.py) | _O(n)_ | _O(1)_ | Easy | | Prefix Sum
3030 | [Find the Grid of Region Average](https://leetcode.com/problems/find-the-grid-of-region-average/) | [C++](./C++/find-the-grid-of-region-average.cpp) [Python](./Python/find-the-grid-of-region-average.py) | _O(m * n)_ | _O(m * n)_ | Medium | | Array
3033 | [Modify the Matrix](https://leetcode.com/problems/modify-the-matrix/) | [C++](./C++/modify-the-matrix.cpp) [Python](./Python/modify-the-matrix.py) | _O(m * n)_ | _O(1)_ | Easy | | Array
3038 | [Maximum Number of Operations With the Same Score I](https://leetcode.com/problems/maximum-number-of-operations-with-the-same-score-i/) | [C++](./C++/maximum-number-of-operations-with-the-same-score-i.cpp) [Python](./Python/maximum-number-of-operations-with-the-same-score-i.py) | _O(n)_ | _O(1)_ | Easy | | Array
3065 | [Minimum Operations to Exceed Threshold Value I](https://leetcode.com/problems/minimum-operations-to-exceed-threshold-value-i/) | [C++](./C++/minimum-operations-to-exceed-threshold-value-i.cpp) [Python](./Python/minimum-operations-to-exceed-threshold-value-i.py) | _O(n)_ | _O(1)_ | Easy | | Array
3069 | [Distribute Elements Into Two Arrays I](https://leetcode.com/problems/distribute-elements-into-two-arrays-i/) | [C++](./C++/distribute-elements-into-two-arrays-i.cpp) [Python](./Python/distribute-elements-into-two-arrays-i.py) | _O(n)_ | _O(n)_ | Easy | | Array
3070 | [Count Submatrices with Top-Left Element and Sum Less Than k](https://leetcode.com/problems/count-submatrices-with-top-left-element-and-sum-less-than-k/) | [C++](./C++/count-submatrices-with-top-left-element-and-sum-less-than-k.cpp) [Python](./Python/count-submatrices-with-top-left-element-and-sum-less-than-k.py) | _O(n * m)_ | _O(1)_ | Medium | | Array, Prefix Sum
3071 | [Minimum Operations to Write the Letter Y on a Grid](https://leetcode.com/problems/minimum-operations-to-write-the-letter-y-on-a-grid/) | [C++](./C++/minimum-operations-to-write-the-letter-y-on-a-grid.cpp) [Python](./Python/minimum-operations-to-write-the-letter-y-on-a-grid.py) | _O(n^2)_ | _O(1)_ | Medium | | Array
3079 | [Find the Sum of Encrypted Integers](https://leetcode.com/problems/find-the-sum-of-encrypted-integers/) | [C++](./C++/find-the-sum-of-encrypted-integers.cpp) [Python](./Python/find-the-sum-of-encrypted-integers.py) | _O(nlogr)_ | _O(1)_ | Easy | | Array
3096 | [Minimum Levels to Gain More Points](https://leetcode.com/problems/minimum-levels-to-gain-more-points/) | [C++](./C++/minimum-levels-to-gain-more-points.cpp) [Python](./Python/minimum-levels-to-gain-more-points.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum
3105 | [Longest Strictly Increasing or Strictly Decreasing Subarray](https://leetcode.com/problems/longest-strictly-increasing-or-strictly-decreasing-subarray/) | [C++](./C++/longest-strictly-increasing-or-strictly-decreasing-subarray.cpp) [Python](./Python/longest-strictly-increasing-or-strictly-decreasing-subarray.py) | _O(n)_ | _O(1)_ | Easy | | Array
3127 | [Make a Square with the Same Color](https://leetcode.com/problems/make-a-square-with-the-same-color/) | [C++](./C++/make-a-square-with-the-same-color.cpp) [Python](./Python/make-a-square-with-the-same-color.py) | _O((n - w + 1)^2 * w^2)_ | _O(1)_ | Easy | | Array
3131 | [Find the Integer Added to Array I](https://leetcode.com/problems/find-the-integer-added-to-array-i/) | [C++](./C++/find-the-integer-added-to-array-i.cpp) [Python](./Python/find-the-integer-added-to-array-i.py) | _O(n)_ | _O(1)_ | Easy | | Array
3142 | [Check if Grid Satisfies Conditions](https://leetcode.com/problems/check-if-grid-satisfies-conditions/) | [C++](./C++/check-if-grid-satisfies-conditions.cpp) [Python](./Python/check-if-grid-satisfies-conditions.py) | _O(m * n)_ | _O(1)_ | Easy | | Array
3147 | [Taking Maximum Energy From the Mystic Dungeon](https://leetcode.com/problems/taking-maximum-energy-from-the-mystic-dungeon/) | [C++](./C++/taking-maximum-energy-from-the-mystic-dungeon.cpp) [Python](./Python/taking-maximum-energy-from-the-mystic-dungeon.py) | _O(n)_ | _O(1)_ | Medium | | Array
3151 | [Special Array I](https://leetcode.com/problems/special-array-i/) | [C++](./C++/special-array-i.cpp) [Python](./Python/special-array-i.py) | _O(n)_ | _O(1)_ | Easy | | Array
3152 | [Special Array II](https://leetcode.com/problems/special-array-ii/) | [C++](./C++/special-array-ii.cpp) [Python](./Python/special-array-ii.py) | _O(n + q)_ | _O(n)_ | Medium | | Prefix Sum
3153 | [Sum of Digit Differences of All Pairs](https://leetcode.com/problems/sum-of-digit-differences-of-all-pairs/) | [C++](./C++/sum-of-digit-differences-of-all-pairs.cpp) [Python](./Python/sum-of-digit-differences-of-all-pairs.py) | _O(nlogr)_ | _O(10 * logr)_ | Medium | | Prefix Sum
3159 | [Find Occurrences of an Element in an Array](https://leetcode.com/problems/find-occurrences-of-an-element-in-an-array/) | [C++](./C++/find-occurrences-of-an-element-in-an-array.cpp) [Python](./Python/find-occurrences-of-an-element-in-an-array.py) | _O(n + q)_ | _O(n)_ | Medium | | Array
3173 | [Bitwise OR of Adjacent Elements](https://leetcode.com/problems/bitwise-or-of-adjacent-elements/) | [C++](./C++/bitwise-or-of-adjacent-elements.cpp) [Python](./Python/bitwise-or-of-adjacent-elements.py) | _O(n)_ | _O(1)_ | Easy | π | Array
3187 | [Peaks in Array](https://leetcode.com/problems/peaks-in-array/) | [C++](./C++/peaks-in-array.cpp) [Python](./Python/peaks-in-array.py) | _O(n + qlogn)_ | _O(n)_ | Hard | | BIT, Fenwick Tree
3195 | [Find the Minimum Area to Cover All Ones I](https://leetcode.com/problems/find-the-minimum-area-to-cover-all-ones-i/) | [C++](./C++/find-the-minimum-area-to-cover-all-ones-i.cpp) [Python](./Python/find-the-minimum-area-to-cover-all-ones-i.py) | _O(n * m)_ | _O(1)_ | Medium | | Array
3224 | [Minimum Array Changes to Make Differences Equal](https://leetcode.com/problems/minimum-array-changes-to-make-differences-equal/) | [C++](./C++/minimum-array-changes-to-make-differences-equal.cpp) [Python](./Python/minimum-array-changes-to-make-differences-equal.py) | _O(n + k)_ | _O(k)_ | Medium | | Prefix Sum, Difference Array
3279 | [Maximum Total Area Occupied by Pistons](https://leetcode.com/problems/maximum-total-area-occupied-by-pistons/) | [C++](./C++/maximum-total-area-occupied-by-pistons.cpp) [Python](./Python/maximum-total-area-occupied-by-pistons.py) | _O(h)_ | _O(h)_ | Hard | π | Line Sweep, Difference Array
3285 | [Find Indices of Stable Mountains](https://leetcode.com/problems/find-indices-of-stable-mountains/) | [C++](./C++/find-indices-of-stable-mountains.cpp) [Python](./Python/find-indices-of-stable-mountains.py) | _O(n)_ | _O(1)_ | Easy | | Array
3300 | [Minimum Element After Replacement With Digit Sum](https://leetcode.com/problems/minimum-element-after-replacement-with-digit-sum/) | [C++](./C++/minimum-element-after-replacement-with-digit-sum.cpp) [Python](./Python/minimum-element-after-replacement-with-digit-sum.py) | _O(nlogr)_ | _O(1)_ | Easy | | Array
3330 | [Find the Original Typed String I](https://leetcode.com/problems/find-the-original-typed-string-i/) | [C++](./C++/find-the-original-typed-string-i.cpp) [Python](./Python/find-the-original-typed-string-i.py) | _O(n)_ | _O(1)_ | Easy | | Array
3334 | [Find the Maximum Factor Score of Array](https://leetcode.com/problems/find-the-maximum-factor-score-of-array/) | [C++](./C++/find-the-maximum-factor-score-of-array.cpp) [Python](./Python/find-the-maximum-factor-score-of-array.py) | _O(nlogr)_ | _O(n)_ | Medium | | Prefix Sum
3349 | [Adjacent Increasing Subarrays Detection I](https://leetcode.com/problems/adjacent-increasing-subarrays-detection-i/) | [C++](./C++/adjacent-increasing-subarrays-detection-i.cpp) [Python](./Python/adjacent-increasing-subarrays-detection-i.py) | _O(n)_ | _O(1)_ | Easy | | Array
3350 | [Adjacent Increasing Subarrays Detection II](https://leetcode.com/problems/adjacent-increasing-subarrays-detection-ii/) | [C++](./C++/adjacent-increasing-subarrays-detection-ii.cpp) [Python](./Python/adjacent-increasing-subarrays-detection-ii.py) | _O(n)_ | _O(1)_ | Medium | | Array
3353 | [Minimum Total Operations](https://leetcode.com/problems/minimum-total-operations/) | [C++](./C++/minimum-total-operations.cpp) [Python](./Python/minimum-total-operations.py) | _O(n)_ | _O(1)_ | Easy | π | Array
3354 | [Make Array Elements Equal to Zero](https://leetcode.com/problems/make-array-elements-equal-to-zero/) | [C++](./C++/make-array-elements-equal-to-zero.cpp) [Python](./Python/make-array-elements-equal-to-zero.py) | _O(n)_ | _O(n)_ | Easy | [CodeChef Starters 146 - Bouncing Ball](https://www.codechef.com/problems/BOUNCE_BALL) | Prefix Sum
3355 | [Zero Array Transformation I](https://leetcode.com/problems/zero-array-transformation-i/) | [C++](./C++/zero-array-transformation-i.cpp) [Python](./Python/zero-array-transformation-i.py) | _O(n + q)_ | _O(n)_ | Medium | | Line Sweep
3361 | [Shift Distance Between Two Strings](https://leetcode.com/problems/shift-distance-between-two-strings/) | [C++](./C++/shift-distance-between-two-strings.cpp) [Python](./Python/shift-distance-between-two-strings.py) | _O(n + 26)_ | _O(26)_ | Medium | | Prefix Sum
3379 | [Transformed Array](https://leetcode.com/problems/transformed-array/) | [C++](./C++/transformed-array.cpp) [Python](./Python/transformed-array.py) | _O(n)_ | _O(1)_ | Easy | | Array
3380 | [Maximum Area Rectangle With Point Constraints I](https://leetcode.com/problems/maximum-area-rectangle-with-point-constraints-i/) | [C++](./C++/maximum-area-rectangle-with-point-constraints-i.cpp) [Python](./Python/maximum-area-rectangle-with-point-constraints-i.py) | _O(nlogn)_ | _O(n)_ | Medium | | Sort, Brute Force, BIT, Fenwick Tree, Hash Table
3382 | [Maximum Area Rectangle With Point Constraints II](https://leetcode.com/problems/maximum-area-rectangle-with-point-constraints-ii/) | [C++](./C++/maximum-area-rectangle-with-point-constraints-ii.cpp) [Python](./Python/maximum-area-rectangle-with-point-constraints-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sort, BIT, Fenwick Tree, Hash Table
3386 | [Button with Longest Push Time](https://leetcode.com/problems/button-with-longest-push-time/) | [C++](./C++/button-with-longest-push-time.cpp) [Python](./Python/button-with-longest-push-time.py) | _O(n)_ | _O(1)_ | Easy | | Array
3392 | [Count Subarrays of Length Three With a Condition](https://leetcode.com/problems/count-subarrays-of-length-three-with-a-condition/) | [C++](./C++/count-subarrays-of-length-three-with-a-condition.cpp) [Python](./Python/count-subarrays-of-length-three-with-a-condition.py) | _O(n)_ | _O(1)_ | Easy | | Array
3400 | [Maximum Number of Matching Indices After Right Shifts](https://leetcode.com/problems/maximum-number-of-matching-indices-after-right-shifts/) | [C++](./C++/maximum-number-of-matching-indices-after-right-shifts.cpp) [Python](./Python/maximum-number-of-matching-indices-after-right-shifts.py) | _O(n^2)_ | _O(1)_ | Medium | π | Brute Force
3417 | [Zigzag Grid Traversal With Skip](https://leetcode.com/problems/zigzag-grid-traversal-with-skip/) | [C++](./C++/zigzag-grid-traversal-with-skip.cpp) [Python](./Python/zigzag-grid-traversal-with-skip.py) | _O(n * m)_ | _O(1)_ | Easy | | Array
3423 | [Maximum Difference Between Adjacent Elements in a Circular Array](https://leetcode.com/problems/zmaximum-difference-between-adjacent-elements-in-a-circular-array/) | [C++](./C++/maximum-difference-between-adjacent-elements-in-a-circular-array.cpp) [Python](./Python/maximum-difference-between-adjacent-elements-in-a-circular-array.py) | _O(n)_ | _O(1)_ | Easy | | Array
3427 | [Sum of Variable Length Subarrays](https://leetcode.com/problems/sum-of-variable-length-subarrays/) | [C++](./C++/sum-of-variable-length-subarrays.cpp) [Python](./Python/sum-of-variable-length-subarrays.py) | _O(n)_ | _O(n)_ | Easy | | Difference Array
3432 | [Count Partitions with Even Sum Difference](https://leetcode.com/problems/count-partitions-with-even-sum-difference/) | [C++](./C++/count-partitions-with-even-sum-difference.cpp) [Python](./Python/count-partitions-with-even-sum-difference.py) | _O(n)_ | _O(1)_ | Easy | | Prefix Sum
3440 | [Reschedule Meetings for Maximum Free Time II](https://leetcode.com/problems/reschedule-meetings-for-maximum-free-time-ii/) | [C++](./C++/reschedule-meetings-for-maximum-free-time-ii.cpp) [Python](./Python/reschedule-meetings-for-maximum-free-time-ii.py) | _O(n)_ | _O(1)_ | Medium | | Array
3446 | [Sort Matrix by Diagonals](https://leetcode.com/problems/sort-matrix-by-diagonals/) | [C++](./C++/sort-matrix-by-diagonals.cpp) [Python](./Python/sort-matrix-by-diagonals.py) | _O(n^2 * logn)_ | _O(n^2)_ | Medium | | Array, Sort
3452 | [Sum of Good Numbers](https://leetcode.com/problems/sum-of-good-numbers/) | [C++](./C++/sum-of-good-numbers.cpp) [Python](./Python/sum-of-good-numbers.py) | _O(n)_ | _O(1)_ | Easy | | Array
3467 | [Transform Array by Parity](https://leetcode.com/problems/transform-array-by-parity/) | [C++](./C++/transform-array-by-parity.cpp) [Python](./Python/transform-array-by-parity.py) | _O(n)_ | _O(1)_ | Easy | | Array
3502 | [Minimum Cost to Reach Every Position](https://leetcode.com/problems/minimum-cost-to-reach-every-position/) | [C++](./C++/minimum-cost-to-reach-every-position.cpp) [Python](./Python/minimum-cost-to-reach-every-position.py) | _O(n)_ | _O(1)_ | Easy | | Prefix Sum
3514 | [Number of Unique XOR Triplets II](https://leetcode.com/problems/number-of-unique-xor-triplets-ii/) | [C++](./C++/number-of-unique-xor-triplets-ii.cpp) [Python](./Python/number-of-unique-xor-triplets-ii.py) | _O(nlogn)_ | _O(n)_ | Medium | | `Fast WalshβHadamard Transform`, FWHT, `Fast Subset Transform`, FST, Hash Table
3531 | [Count Covered Buildings](https://leetcode.com/problems/count-covered-buildings/) | [C++](./C++/count-covered-buildings.cpp) [Python](./Python/count-covered-buildings.py) | _O(n)_ | _O(n)_ | Medium | | Array
3537 | [Fill a Special Grid](https://leetcode.com/problems/fill-a-special-grid/) | [C++](./C++/fill-a-special-grid.cpp) [Python](./Python/fill-a-special-grid.py) | _O(4^n)_ | _O(1)_ | Medium | | Divide and Conquer, Array
3540 | [Minimum Time to Visit All Houses](https://leetcode.com/problems/minimum-time-to-visit-all-houses/) | [C++](./C++/minimum-time-to-visit-all-houses.cpp) [Python](./Python/minimum-time-to-visit-all-houses.py) | _O(n + q)_ | _O(n)_ | Medium | π | Prefix Sum
3546 | [Equal Sum Grid Partition I](https://leetcode.com/problems/equal-sum-grid-partition-i/) | [C++](./C++/equal-sum-grid-partition-i.cpp) [Python](./Python/equal-sum-grid-partition-i.py) | _O(m * n)_ | _O(1)_ | Medium | | Array
3548 | [Equal Sum Grid Partition II](https://leetcode.com/problems/equal-sum-grid-partition-ii/) | [C++](./C++/equal-sum-grid-partition-ii.cpp) [Python](./Python/equal-sum-grid-partition-ii.py) | _O(m * n)_ | _O(m * n)_ | Hard | | Array, Hash Table
3549 | [Multiply Two Polynomials](https://leetcode.com/problems/multiply-two-polynomials/) | [C++](./C++/multiply-two-polynomials.cpp) [Python](./Python/multiply-two-polynomials.py) | _O((n + m) * log(n + m))_ | _O(n + m)_ | Hard | π | `Fast Fourier Transform`, FFT
3550 | [Smallest Index With Digit Sum Equal to Index](https://leetcode.com/problems/smallest-index-with-digit-sum-equal-to-index/) | [C++](./C++/smallest-index-with-digit-sum-equal-to-index.cpp) [Python](./Python/smallest-index-with-digit-sum-equal-to-index.py) | _O(nlogr)_ | _O(1)_ | Easy | | Array
3569 | [Maximize Count of Distinct Primes After Split](https://leetcode.com/problems/maximize-count-of-distinct-primes-after-splitx/) | [C++](./C++/maximize-count-of-distinct-primes-after-split.cpp) [Python](./Python/maximize-count-of-distinct-primes-after-split.py) | _O(r + nlogn + qlogn)_ | _O(r + n)_ | Medium | | Number Theory, BST, Sorted List, Segment Tree
3637 | [Trionic Array I](https://leetcode.com/problems/trionic-array-i/) | [C++](./C++/trionic-array-i.cpp) [Python](./Python/trionic-array-i.py) | _O(n)_ | _O(1)_ | Easy | | Array
3643 | [Flip Square Submatrix Vertically](https://leetcode.com/problems/flip-square-submatrix-vertically/) | [C++](./C++/flip-square-submatrix-vertically.cpp) [Python](./Python/flip-square-submatrix-vertically.py) | _O(k^2)_ | _O(1)_ | Easy | | Array
3653 | [XOR After Range Multiplication Queries I](https://leetcode.com/problems/xor-after-range-multiplication-queries-i/) | [C++](./C++/xor-after-range-multiplication-queries-i.cpp) [Python](./Python/xor-after-range-multiplication-queries-i.py) | _O(qlogm + (q + n) * sqrt(n))_ | _O(n * sqrt(n))_ | Medium || Sqrt Decomposition, Difference Array, Fast Exponentiation, Simulation
3655 | [XOR After Range Multiplication Queries II](https://leetcode.com/problems/xor-after-range-multiplication-queries-ii/) | [C++](./C++/xor-after-range-multiplication-queries-ii.cpp) [Python](./Python/xor-after-range-multiplication-queries-ii.py) | _O(qlogm + (q + n) * sqrt(n))_ | _O(n * sqrt(n))_ | Hard || Sqrt Decomposition, Difference Array, Fast Exponentiation
3674 | [Minimum Operations to Equalize Array](https://leetcode.com/problems/minimum-operations-to-equalize-array/) | [C++](./C++/minimum-operations-to-equalize-array.cpp) [Python](./Python/minimum-operations-to-equalize-array.py) | _O(n)_ | _O(1)_ | Easy || Array
3683 | [Earliest Time to Finish One Task](https://leetcode.com/problems/earliest-time-to-finish-one-task/) | [C++](./C++/earliest-time-to-finish-one-task.cpp) [Python](./Python/earliest-time-to-finish-one-task.py) | _O(n)_ | _O(1)_ | Easy || Array
3687 | [Library Late Fee Calculator](https://leetcode.com/problems/library-late-fee-calculator/) | [C++](./C++/library-late-fee-calculator.cpp) [Python](./Python/library-late-fee-calculator.py) | _O(n)_ | _O(1)_ | Easy |π| Array
3688 | [Bitwise OR of Even Numbers in an Array](https://leetcode.com/problems/bitwise-or-of-even-numbers-in-an-array/) | [C++](./C++/bitwise-or-of-even-numbers-in-an-array.cpp) [Python](./Python/bitwise-or-of-even-numbers-in-an-array.py) | _O(n)_ | _O(1)_ | Easy || Array
3696 | [Maximum Distance Between Unequal Words in Array I](https://leetcode.com/problems/maximum-distance-between-unequal-words-in-array-i/) | [C++](./C++/maximum-distance-between-unequal-words-in-array-i.cpp) [Python](./Python/maximum-distance-between-unequal-words-in-array-i.py) | _O(n * l)_ | _O(1)_ | Easy |π| Array
3700 | [Number of ZigZag Arrays II](https://leetcode.com/problems/number-of-zigzag-arrays-ii/) | [C++](./C++/number-of-zigzag-arrays-ii.cpp) [Python](./Python/number-of-zigzag-arrays-ii.py) | _O((r - l)^3 * logn)_ | _O((r - l)^2)_ | Hard | | Matrix Exponentiation
3701 | [Compute Alternating Sum](https://leetcode.com/problems/compute-alternating-sum/) | [C++](./C++/compute-alternating-sum.cpp) [Python](./Python/compute-alternating-sum.py) | _O(n)_ | _O(1)_ | Easy | | Array
3706 | [Maximum Distance Between Unequal Words in Array II](https://leetcode.com/problems/maximum-distance-between-unequal-words-in-array-ii/) | [C++](./C++/maximum-distance-between-unequal-words-in-array-ii.cpp) [Python](./Python/maximum-distance-between-unequal-words-in-array-ii.py) | _O(n * l)_ | _O(1)_ | Medium |π| Array
3707 | [Equal Score Substrings](https://leetcode.com/problems/equal-score-substrings/) | [C++](./C++/equal-score-substrings.cpp) [Python](./Python/equal-score-substrings.py) | _O(n)_ | _O(1)_ | Easy | | Array, Prefix Sum
3708 | [Longest Fibonacci Subarray](https://leetcode.com/problems/longest-fibonacci-subarray/) | [C++](./C++/longest-fibonacci-subarray.cpp) [Python](./Python/longest-fibonacci-subarray.py) | _O(n)_ | _O(1)_ | Medium | | Array
3719 | [Longest Balanced Subarray I](https://leetcode.com/problems/longest-balanced-subarray-i/) | [C++](./C++/longest-balanced-subarray-i.cpp) [Python](./Python/longest-balanced-subarray-i.py) | _O(nlogn)_ | _O(n)_ | Medium | | Brute Force, Segment Tree, Binary Search, Prefix Sum
3721 | [Longest Balanced Subarray II](https://leetcode.com/problems/longest-balanced-subarray-ii/) | [C++](./C++/longest-balanced-subarray-ii.cpp) [Python](./Python/longest-balanced-subarray-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | | Segment Tree, Binary Search, Prefix Sum
3736 | [Minimum Moves to Equal Array Elements III](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-iii/) | [C++](./C++/minimum-moves-to-equal-array-elements-iii.cpp) [Python](./Python/minimum-moves-to-equal-array-elements-iii.py) | _O(n)_ | _O(1)_ | Easy | | Array
3737 | [Count Subarrays With Majority Element I](https://leetcode.com/problems/count-subarrays-with-majority-element-i/) | [C++](./C++/count-subarrays-with-majority-element-i.cpp) [Python](./Python/count-subarrays-with-majority-element-i.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Prefix Sum
3738 | [Longest Non-Decreasing Subarray After Replacing at Most One Element](https://leetcode.com/problems/longest-non-decreasing-subarray-after-replacing-at-most-one-element/) | [C++](./C++/longest-non-decreasing-subarray-after-replacing-at-most-one-element.cpp) [Python](./Python/longest-non-decreasing-subarray-after-replacing-at-most-one-element.py) | _O(n)_ | _O(n)_ | Medium | | Array, Prefix Sum
3739 | [Count Subarrays With Majority Element II](https://leetcode.com/problems/count-subarrays-with-majority-element-ii/) | [C++](./C++/count-subarrays-with-majority-element-ii.cpp) [Python](./Python/count-subarrays-with-majority-element-ii.py) | _O(n)_ | _O(n)_ | Hard | | Freq Table, Prefix Sum
3751 | [Total Waviness of Numbers in Range I](https://leetcode.com/problems/total-waviness-of-numbers-in-range-i/) | [C++](./C++/total-waviness-of-numbers-in-range-i.cpp) [Python](./Python/total-waviness-of-numbers-in-range-i.py) | _O(nlogn)_ | _O(logn)_ | Medium | | Brute Force
3756 | [Concatenate Non-Zero Digits and Multiply by Sum II](https://leetcode.com/problems/concatenate-non-zero-digits-and-multiply-by-sum-ii/) | [C++](./C++/concatenate-non-zero-digits-and-multiply-by-sum-ii.cpp) [Python](./Python/concatenate-non-zero-digits-and-multiply-by-sum-ii.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum |
3762 | [Minimum Operations to Equalize Subarrays](https://leetcode.com/problems/minimum-operations-to-equalize-subarrays/) | [C++](./C++/minimum-operations-to-equalize-subarrays.cpp) [Python](./Python/minimum-operations-to-equalize-subarrays.py) | _O((n + q) * logn)_ | _O(nlogn)_ | Hard | | Prefix Sum, Coordinate Compression, Persistent Segment Tree, Binary Search |
3774 | [Absolute Difference Between Maximum and Minimum K Elements](https://leetcode.com/problems/absolute-difference-between-maximum-and-minimum-k-elements/) | [C++](./C++/absolute-difference-between-maximum-and-minimum-k-elements.cpp) [Python](./Python/absolute-difference-between-maximum-and-minimum-k-elements.py) | _O(n)_ | _O(1)_ | Easy | | Sort, Quick Select
3788 | [Maximum Score of a Split](https://leetcode.com/problems/maximum-score-of-a-split/) | [C++](./C++/maximum-score-of-a-split.cpp) [Python](./Python/maximum-score-of-a-split.py) | _O(n)_ | _O(1)_ | Medium | | Prefix Sum
3809 | [Best Reachable Tower](https://leetcode.com/problems/best-reachable-tower/) | [C++](./C++/best-reachable-tower.cpp) [Python](./Python/best-reachable-tower.py) | _O(n)_ | _O(1)_ | Medium | | Array
3814 | [Maximum Capacity Within Budget](https://leetcode.com/problems/maximum-capacity-within-budget/) | [C++](./C++/maximum-capacity-within-budget.cpp) [Python](./Python/maximum-capacity-within-budget.py) | _O(n + b)_ | _O(b)_ | Medium | | Hash Table, Prefix Sum, Sort, Mono Stack, Binary Search
3818 | [Minimum Prefix Removal to Make Array Strictly Increasing](https://leetcode.com/problems/minimum-prefix-removal-to-make-array-strictly-increasing/) | [C++](./C++/minimum-prefix-removal-to-make-array-strictly-increasing.cpp) [Python](./Python/minimum-prefix-removal-to-make-array-strictly-increasing.py) | _O(n)_ | _O(1)_ | Medium | | Array
3819 | [Rotate Non Negative Elements](https://leetcode.com/problems/rotate-non-negative-elements/) | [C++](./C++/rotate-non-negative-elements.cpp) [Python](./Python/rotate-non-negative-elements.py) | _O(n)_ | _O(n)_ | Medium | | Array
3833 | [Count Dominant Indices](https://leetcode.com/problems/count-dominant-indices/) | [C++](./C++/count-dominant-indices.cpp) [Python](./Python/count-dominant-indices.py) | _O(n)_ | _O(1)_ | Easy | | Array
3861 | [Minimum Capacity Box](https://leetcode.com/problems/minimum-capacity-box/) | [C++](./C++/minimum-capacity-box.cpp) [Python](./Python/minimum-capacity-box.py) | _O(n)_ | _O(1)_ | Easy | | Array
3862 | [Find the Smallest Balanced Index](https://leetcode.com/problems/find-the-smallest-balanced-index/) | [C++](./C++/find-the-smallest-balanced-index.cpp) [Python](./Python/find-the-smallest-balanced-index.py) | _O(n)_ | _O(1)_ | Medium | | Prefix Sum
3865 | [Reverse K Subarrays](https://leetcode.com/problems/reverse-k-subarrays/) | [C++](./C++/reverse-k-subarrays.cpp) [Python](./Python/reverse-k-subarrays.py) | _O(n)_ | _O(1)_ | Medium | π | Array
3880 | [Minimum Absolute Difference Between Two Values](https://leetcode.com/problems/minimum-absolute-difference-between-two-values/) | [C++](./C++/minimum-absolute-difference-between-two-values.cpp) [Python](./Python/minimum-absolute-difference-between-two-values.py) | _O(n)_ | _O(1)_ | Easy | | Array
3886 | [Sum of Sortable Integers](https://leetcode.com/problems/sum-of-sortable-integers/) | [C++](./C++/sum-of-sortable-integers.cpp) [Python](./Python/sum-of-sortable-integers.py) | _O(nlog(logn))_ | _O(n)_ | Hard | | Prefix Sum, Number Theory
3898 | [Find the Degree of Each Vertex](https://leetcode.com/problems/find-the-degree-of-each-vertex/) | [C++](./C++/find-the-degree-of-each-vertex.cpp) [Python](./Python/find-the-degree-of-each-vertex.py) | _O(n * m)_ | _O(1)_ | Easy | | Array
3903 | [Smallest Stable Index I](https://leetcode.com/problems/smallest-stable-index-i/) | [C++](./C++/smallest-stable-index-i.cpp) [Python](./Python/smallest-stable-index-i.py) | _O(n)_ | _O(n)_ | Easy | | Prefix Sum
3904 | [Smallest Stable Index II](https://leetcode.com/problems/smallest-stable-index-ii/) | [C++](./C++/smallest-stable-index-ii.cpp) [Python](./Python/smallest-stable-index-ii.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum
3907 | [Count Smaller Elements With Opposite Parity](https://leetcode.com/problems/count-smaller-elements-with-opposite-parity/) | [C++](./C++/count-smaller-elements-with-opposite-parity.cpp) [Python](./Python/count-smaller-elements-with-opposite-parity.py) | _O(nlogn)_ | _O(n)_ | Medium | π | Sort, Coordinate Compression, BIT, Fenwick Tree
3909 | [Compare Sums of Bitonic Parts](https://leetcode.com/problems/compare-sums-of-bitonic-parts/) | [C++](./C++/compare-sums-of-bitonic-parts.cpp) [Python](./Python/compare-sums-of-bitonic-parts.py) | _O(n)_ | _O(1)_ | Medium | | Array
3912 | [Valid Elements in an Array](https://leetcode.com/problems/valid-elements-in-an-array/) | [C++](./C++/valid-elements-in-an-array.cpp) [Python](./Python/valid-elements-in-an-array.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum
3915 | [Maximum Sum of Alternating Subsequence With Distance at Least K](https://leetcode.com/problems/minimum-operations-to-make-array-non-decreasing/) | [C++](./C++/minimum-operations-to-make-array-non-decreasing.cpp) [Python](./Python/minimum-operations-to-make-array-non-decreasing.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sort, Coordinate Compression, BIT, Fenwick Tree, Sliding Window, DP
3918 | [Sum of Primes Between Number and Its Reverse](https://leetcode.com/problems/sum-of-primes-between-number-and-its-reverse/) | [C++](./C++/sum-of-primes-between-number-and-its-reverse.cpp) [Python](./Python/sum-of-primes-between-number-and-its-reverse.py) | precompute: _O(r)_
runtime: _O(1)_ | _O(r)_ | Medium | | Number Theory, `Linear Sieve of Eratosthenes`, Prefix Sum
3925 | [Concatenate Array With Reverse](https://leetcode.com/problems/concatenate-array-with-reverse/) | [C++](./C++/concatenate-array-with-reverse.cpp) [Python](./Python/concatenate-array-with-reverse.py) | _O(n)_ | _O(1)_ | Easy | | Array
3933 | [Largest Local Values in a Matrix II](https://leetcode.com/problems/largest-local-values-in-a-matrix-ii/) | [C++](./C++/largest-local-values-in-a-matrix-ii.cpp) [Python](./Python/largest-local-values-in-a-matrix-ii.py) | _O(n * m * logn * logm)_ | _O(n * m * logn * logm)_ | Medium | | RMQ, 2D Sparse Table
3936 | [Minimum Swaps to Move Zeros to End](https://leetcode.com/problems/minimum-swaps-to-move-zeros-to-end/) | [C++](./C++/minimum-swaps-to-move-zeros-to-end.cpp) [Python](./Python/minimum-swaps-to-move-zeros-to-end.py) | _O(n)_ | _O(1)_ | Easy | | Array
3938 | [Maximum Path Intersection Sum in a Grid](https://leetcode.com/problems/maximum-path-intersection-sum-in-a-grid/) | [C++](./C++/maximum-path-intersection-sum-in-a-grid.cpp) [Python](./Python/maximum-path-intersection-sum-in-a-grid.py) | _O(n * m)_ | _O(1)_ | Medium | | Array, `Kadane's Algorithm`
3940 | [Limit Occurrences in Sorted Array](https://leetcode.com/problems/limit-occurrences-in-sorted-array/) | [C++](./C++/limit-occurrences-in-sorted-array.cpp) [Python](./Python/limit-occurrences-in-sorted-array.py) | _O(n)_ | _O(1)_ | Easy | | Array, Inplace
3942 | [Minimum Operations to Sort a Permutation](https://leetcode.com/problems/minimum-operations-to-sort-a-permutation/) | [C++](./C++/minimum-operations-to-sort-a-permutation.cpp) [Python](./Python/minimum-operations-to-sort-a-permutation.py) | _O(n)_ | _O(1)_ | Medium | | Array
3943 | [Number of Pairs After Increment](https://leetcode.com/problems/number-of-pairs-after-increment/) | [C++](./C++/number-of-pairs-after-increment.cpp) [Python](./Python/number-of-pairs-after-increment.py) | _O(n + m + q * sqrt(m * n))_ | _O(n + m)_ | Hard || Freq Table, Sqrt Decomposition
3951 | [Minimum Energy to Maintain Brightness](https://leetcode.com/problems/minimum-energy-to-maintain-brightness/) | [C++](./C++/minimum-energy-to-maintain-brightness.cpp) [Python](./Python/minimum-energy-to-maintain-brightness.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Line Sweep
3951 | [Minimum Energy to Maintain Brightness](https://leetcode.com/problems/minimum-energy-to-maintain-brightness/) | [C++](./C++/minimum-energy-to-maintain-brightness.cpp) [Python](./Python/minimum-energy-to-maintain-brightness.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Line Sweep
3963 | [Create Grid With Exactly One Path](https://leetcode.com/problems/create-grid-with-exactly-one-path/) | [C++](./C++/create-grid-with-exactly-one-path.cpp) [Python](./Python/create-grid-with-exactly-one-path.py) | _O(m * n)_ | _O(1)_ | Easy | | Array
3978 | [Unique Middle Element](https://leetcode.com/problems/unique-middle-element/) | [C++](./C++/unique-middle-element.cpp) [Python](./Python/unique-middle-element.py) | _O(n)_ | _O(1)_ | Easy | | Array
3979 | [Maximum Valid Pair Sum](https://leetcode.com/problems/maximum-valid-pair-sum/) | [C++](./C++/maximum-valid-pair-sum.cpp) [Python](./Python/maximum-valid-pair-sum.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum
3982 | [Sum of Integers with Maximum Digit Range](https://leetcode.com/problems/sum-of-integers-with-maximum-digit-range/) | [C++](./C++/sum-of-integers-with-maximum-digit-range.cpp) [Python](./Python/sum-of-integers-with-maximum-digit-range.py) | _O(nlogr)_ | _O(1)_ | Easy | | Array
3985 | [Palindromic Subarray Sum](https://leetcode.com/problems/palindromic-subarray-sum/) | [C++](./C++/palindromic-subarray-sum.cpp) [Python](./Python/palindromic-subarray-sum.py) | _O(n)_ | _O(n)_ | Hard | | Prefix Sum, `Manacher's Algorithm`
3998 | [Transform Binary String Using Subsequence Sort](https://leetcode.com/problems/transform-binary-string-using-subsequence-sort/) | [C++](./C++/transform-binary-string-using-subsequence-sort.cpp) [Python](./Python/transform-binary-string-using-subsequence-sort.py) | _O(n * m)_ | _O(n)_ | Hard | | Prefix Sum
4006 | [Count Valid Prefixes](https://leetcode.com/problems/count-valid-prefixes/) | [C++](./C++/count-valid-prefixes.cpp) [Python](./Python/count-valid-prefixes.py) | _O(n)_ | _O(1)_ | Easy | | Prefix Sum
4010 | [Maximize Pair Strength Using GCD](https://leetcode.com/problems/maximize-pair-strength-using-gcd/) | [C++](./C++/maximize-pair-strength-using-gcd.cpp) [Python](./Python/maximize-pair-strength-using-gcd.py) | _O(n^2 * logr)_ | _O(1)_ | Easy | | Brute Force, Sort, Pruning
4011 | [Count Subarrays With Even Odd Ratio I](https://leetcode.com/problems/count-subarrays-with-even-odd-ratio-i/) | [C++](./C++/count-subarrays-with-even-odd-ratio-i.cpp) [Python](./Python/count-subarrays-with-even-odd-ratio-i.py) | _O(nlogn)_ | _O(n)_ | Medium | | Prefix Sum, Sort, Coordinate Compression, BIT, Fenwick Tree, Brute Force
4012 | [Count of Unfinished Tasks After Each Shift](https://leetcode.com/problems/count-of-unfinished-tasks-after-each-shift/) | [C++](./C++/count-of-unfinished-tasks-after-each-shift.cpp) [Python](./Python/count-of-unfinished-tasks-after-each-shift.py) | _O(n + mlogn)_ | _O(n)_ | Medium | | Prefix Sum, Binary Search
4013 | [Count Subarrays With Even Odd Ratio II](https://leetcode.com/problems/count-subarrays-with-even-odd-ratio-ii/) | [C++](./C++/count-subarrays-with-even-odd-ratio-ii.cpp) [Python](./Python/count-subarrays-with-even-odd-ratio-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | | Prefix Sum, Sort, Coordinate Compression, BIT, Fenwick Tree
4017 | [Peaks in Array II](https://leetcode.com/problems/peaks-in-array-ii/) | [C++](./C++/peaks-in-array-ii.cpp) [Python](./Python/peaks-in-array-ii.py) | _O(nlogn + qlogn)_ | _O(n)_ | Hard | | BIT, Fenwick Tree
4020 | [Elevator Requests I](https://leetcode.com/problems/elevator-requests-i/) | [C++](./C++/elevator-requests-i.cpp) [Python](./Python/elevator-requests-i.py) | _O(m)_ | _O(1)_ | Easy | | Array
4021 | [Minimum Operations to Make a Rotated Palindrome I](https://leetcode.com/problems/minimum-operations-to-make-a-rotated-palindrome-i/) | [C++](./C++/minimum-operations-to-make-a-rotated-palindrome-i.cpp) [Python](./Python/minimum-operations-to-make-a-rotated-palindrome-i.py) | _O(nlogn)_ | _O(n)_ | Medium | | Brute Force, NTT
4024 | [Nearest Available Drone](https://leetcode.com/problems/nearest-available-drone/) | [C++](./C++/nearest-available-drone.cpp) [Python](./Python/nearest-available-drone.py) | _O(n)_ | _O(1)_ | Easy | | Array
4028 | [Minimum Operations to Make a Rotated Palindrome II](https://leetcode.com/problems/minimum-operations-to-make-a-rotated-palindrome-ii/) | [C++](./C++/minimum-operations-to-make-a-rotated-palindrome-ii.cpp) [Python](./Python/minimum-operations-to-make-a-rotated-palindrome-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | π | NTT
4051 | [Count Subarrays with Distant Sums](https://leetcode.com/problems/count-subarrays-with-distant-sums/) | [C++](./C++/count-subarrays-with-distant-sums.cpp) [Python](./Python/count-subarrays-with-distant-sums.py) | _O(nlogn)_ | _O(n)_ | Hard | | Prefix Sum, Sorted List, Ordered Set, BIT, Fenwick Tree
4052 | [Cyclically Shift Rows and Columns](https://leetcode.com/problems/cyclically-shift-rows-and-columns/) | [C++](./C++/cyclically-shift-rows-and-columns.cpp) [Python](./Python/cyclically-shift-rows-and-columns.py) | _O(n^2)_ | _O(1)_ | Easy | | Array, Inplace
4056 | [Number of Intersecting Interval Pairs I](https://leetcode.com/problems/number-of-intersecting-interval-pairs-i/) | [C++](./C++/number-of-intersecting-interval-pairs-i.cpp) [Python](./Python/number-of-intersecting-interval-pairs-i.py) | _O(nlogn)_ | _O(n)_ | Easy | | Brute Force, Sort, Line Sweep
4057 | [Number of Intersecting Interval Pairs II](https://leetcode.com/problems/number-of-intersecting-interval-pairs-ii/) | [C++](./C++/number-of-intersecting-interval-pairs-ii.cpp) [Python](./Python/number-of-intersecting-interval-pairs-ii.py) | _O(nlogn)_ | _O(n)_ | Medium | | Sort, Line Sweep
4058 | [Maximum Pulse Value After One Subarray Rotation](https://leetcode.com/problems/maximum-pulse-value-after-one-subarray-rotation/) | [C++](./C++/maximum-pulse-value-after-one-subarray-rotation.cpp) [Python](./Python/maximum-pulse-value-after-one-subarray-rotation.py) | _O(n)_ | _O(1)_ | Medium | | Prefix Sum, Hash Table
4062 | [Transform Array Using Pair Operations](https://leetcode.com/problems/transform-array-using-pair-operations/) | [C++](./C++/transform-array-using-pair-operations.cpp) [Python](./Python/transform-array-using-pair-operations.py) | _O(n)_ | _O(1)_ | Medium | | Array
4063 | [Longest Subarray Divisible by K with At Most One Negation I](https://leetcode.com/problems/longest-subarray-divisible-by-k-with-at-most-one-negation-i/) | [C++](./C++/longest-subarray-divisible-by-k-with-at-most-one-negation-i.cpp) [Python](./Python/longest-subarray-divisible-by-k-with-at-most-one-negation-i.py) | _O(n + k^2)_ | _O(k)_ | Medium | | Prefix Sum, Hash Table, Brute Force
4064 | [Longest Subarray Divisible by K with At Most One Negation II](https://leetcode.com/problems/longest-subarray-divisible-by-k-with-at-most-one-negation-ii/) | [C++](./C++/longest-subarray-divisible-by-k-with-at-most-one-negation-ii.cpp) [Python](./Python/longest-subarray-divisible-by-k-with-at-most-one-negation-ii.py) | _O(n + k^2)_ | _O(k)_ | Hard | | Prefix Sum, Hash Table
4073 | [Count Good Strings](https://leetcode.com/problems/count-good-strings/) | [C++](./C++/count-good-strings.cpp) [Python](./Python/count-good-strings.py) | _O(logr)_ | _O(1)_ | Hard || Matrix Fast Exponentiation
## String
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
3019 | [Number of Changing Keys](https://leetcode.com/problems/number-of-changing-keys/)| [C++](./C++/number-of-changing-keys.cpp) [Python](./Python/number-of-changing-keys.py)| _O(n)_ | _O(1)_ | Easy | | String |
3023 | [Find Pattern in Infinite Stream I](https://leetcode.com/problems/find-pattern-in-infinite-stream-i/)| [C++](./C++/find-pattern-in-infinite-stream-i.cpp) [Python](./Python/find-pattern-in-infinite-stream-i.py)| _O(p + n)_ | _O(p)_ | Medium | π | String, `KMP Algorithm` |
3029 | [Minimum Time to Revert Word to Initial State I](https://leetcode.com/problems/minimum-time-to-revert-word-to-initial-state-i/)| [C++](./C++/minimum-time-to-revert-word-to-initial-state-i.cpp) [Python](./Python/minimum-time-to-revert-word-to-initial-state-i.py)| _O(n)_ | _O(n)_ | Medium | | String, `Z-Function`, Brute Force |
3031 | [Minimum Time to Revert Word to Initial State II](https://leetcode.com/problems/minimum-time-to-revert-word-to-initial-state-ii/)| [C++](./C++/minimum-time-to-revert-word-to-initial-state-ii.cpp) [Python](./Python/minimum-time-to-revert-word-to-initial-state-ii.py)| _O(n)_ | _O(n)_ | Hard | | String, `Z-Function` |
3034 | [Number of Subarrays That Match a Pattern I](https://leetcode.com/problems/number-of-subarrays-that-match-a-pattern-i/)| [C++](./C++/number-of-subarrays-that-match-a-pattern-i.cpp) [Python](./Python/number-of-subarrays-that-match-a-pattern-i.py)| _O(n)_ | _O(m)_ | Medium | | Brute Force, String, `KMP Algorithm` |
3036 | [Number of Subarrays That Match a Pattern II](https://leetcode.com/problems/number-of-subarrays-that-match-a-pattern-ii/)| [C++](./C++/number-of-subarrays-that-match-a-pattern-ii.cpp) [Python](./Python/number-of-subarrays-that-match-a-pattern-ii.py)| _O(n)_ | _O(m)_ | Hard | | String, `KMP Algorithm` |
3037 | [Find Pattern in Infinite Stream II](https://leetcode.com/problems/find-pattern-in-infinite-stream-ii/)| [C++](./C++/find-pattern-in-infinite-stream-ii.cpp) [Python](./Python/find-pattern-in-infinite-stream-ii.py)| _O(p + n)_ | _O(p)_ | Hard | π | String, `KMP Algorithm` |
3042 | [Count Prefix and Suffix Pairs I](https://leetcode.com/problems/count-prefix-and-suffix-pairs-i/)| [C++](./C++/count-prefix-and-suffix-pairs-i.cpp) [Python](./Python/count-prefix-and-suffix-pairs-i.py)| _O(n * l)_ | _O(t)_ | Easy | | Trie, Brute Force |
3043 | [Find the Length of the Longest Common Prefix](https://leetcode.com/problems/find-the-length-of-the-longest-common-prefix/)| [C++](./C++/find-the-length-of-the-longest-common-prefix.cpp) [Python](./Python/find-the-length-of-the-longest-common-prefix.py)| _O((n + m) * l)_ | _O(t)_ | Medium | | Trie, Hash Table |
3045 | [Count Prefix and Suffix Pairs II](https://leetcode.com/problems/count-prefix-and-suffix-pairs-ii/)| [C++](./C++/count-prefix-and-suffix-pairs-ii.cpp) [Python](./Python/count-prefix-and-suffix-pairs-ii.py)| _O(n * l)_ | _O(t)_ | Hard | | Trie |
3076 | [Shortest Uncommon Substring in an Array](https://leetcode.com/problems/shortest-uncommon-substring-in-an-array/)| [C++](./C++/shortest-uncommon-substring-in-an-array.cpp) [Python](./Python/shortest-uncommon-substring-in-an-array.py)| _O(n * l^2)_ | _O(t)_ | Medium | | Trie |
3093 | [Longest Common Suffix Queries](https://leetcode.com/problems/longest-common-suffix-queries/)| [C++](./C++/longest-common-suffix-queries.cpp) [Python](./Python/longest-common-suffix-queries.py)| _O((n + q) * l)_ | _O(t)_ | Hard | | Trie |
3110 | [Score of a String](https://leetcode.com/problems/score-of-a-string/)| [C++](./C++/score-of-a-string.cpp) [Python](./Python/score-of-a-string.py)| _O(n)_ | _O(1)_ | Easy | | String |
3136 | [Valid Word](https://leetcode.com/problems/valid-word/) | [C++](./C++/valid-word.cpp) [Python](./Python/valid-word.py) | _O(n)_ | _O(1)_ | Easy | | String
3163 | [String Compression III](https://leetcode.com/problems/string-compression-iii/) | [C++](./C++/string-compression-iii.cpp) [Python](./Python/string-compression-iii.py) | _O(n)_ | _O(1)_ | Medium | | String
3210 | [Find the Encrypted String](https://leetcode.com/problems/find-the-encrypted-string/) | [C++](./C++/find-the-encrypted-string.cpp) [Python](./Python/find-the-encrypted-string.py) | _O(n)_ | _O(1)_ | Medium | | String
3271 | [Hash Divided String](https://leetcode.com/problems/hash-divided-string/) | [C++](./C++/hash-divided-string.cpp) [Python](./Python/hash-divided-string.py) | _O(n)_ | _O(1)_ | Medium | | String
3280 | [Convert Date to Binary](https://leetcode.com/problems/convert-date-to-binary/) | [C++](./C++/convert-date-to-binary.cpp) [Python](./Python/convert-date-to-binary.py) | _O(1)_ | _O(1)_ | Easy | | String
3303 | [Find the Occurrence of First Almost Equal Substring](https://leetcode.com/problems/find-the-occurrence-of-first-almost-equal-substring/) | [C++](./C++/find-the-occurrence-of-first-almost-equal-substring.cpp) [Python](./Python/find-the-occurrence-of-first-almost-equal-substring.py) | _O(n + m)_ | _O(n + m)_ | Hard | | `Z-Function`
3324 | [Find the Sequence of Strings Appeared on the Screen](https://leetcode.com/problems/find-the-sequence-of-strings-appeared-on-the-screen/) | [C++](./C++/find-the-sequence-of-strings-appeared-on-the-screen.cpp) [Python](./Python/find-the-sequence-of-strings-appeared-on-the-screen.py) | _O(n^2)_ | _O(1)_ | Medium | | String
3340 | [Check Balanced String](https://leetcode.com/problems/check-balanced-string/) | [C++](./C++/check-balanced-string.cpp) [Python](./Python/check-balanced-string.py) | _O(n)_ | _O(1)_ | Easy | | String
3407 | [Substring Matching Pattern](https://leetcode.com/problems/substring-matching-pattern/) | [C++](./C++/substring-matching-pattern.cpp) [Python](./Python/substring-matching-pattern.py) | _O(n + m)_ | _O(m)_ | Easy | | String, `KMP Algorithm`
3455 | [Shortest Matching Substring](https://leetcode.com/problems/shortest-matching-substring/) | [C++](./C++/shortest-matching-substring.cpp) [Python](./Python/shortest-matching-substring.py) | _O(n + m)_ | _O(n + m)_ | Hard | | String, `KMP Algorithm`, Two Pointers
3456 | [Find Special Substring of Length K](https://leetcode.com/problems/find-special-substring-of-length-k/) | [C++](./C++/find-special-substring-of-length-k.cpp) [Python](./Python/find-special-substring-of-length-k.py) | _O(n)_ | _O(1)_ | Easy | | String
3491 | [Phone Number Prefix](https://leetcode.com/problems/phone-number-prefix/) | [C++](./C++/phone-number-prefix.cpp) [Python](./Python/phone-number-prefix.py) | _O(l * nlogn)_ | _O(1)_ | Easy | π | Trie, Sort
3498 | [Reverse Degree of a String](https://leetcode.com/problems/reverse-degree-of-a-string/) | [C++](./C++/reverse-degree-of-a-string.cpp) [Python](./Python/reverse-degree-of-a-string.py) | _O(n)_ | _O(1)_ | Easy | | String
3529 | [Count Cells in Overlapping Horizontal and Vertical Substrings](https://leetcode.com/problems/count-cells-in-overlapping-horizontal-and-vertical-substrings/) | [C++](./C++/count-cells-in-overlapping-horizontal-and-vertical-substrings.cpp) [Python](./Python/count-cells-in-overlapping-horizontal-and-vertical-substrings.py) | _O(n * m)_ | _O(n * m)_ | Medium | | `Z-Function`
3571 | [Find the Shortest Superstring II](https://leetcode.com/problems/find-the-shortest-superstring-ii/) | [C++](./C++/find-the-shortest-superstring-ii.cpp) [Python](./Python/find-the-shortest-superstring-ii.py) | _O(n + m)_ | _O(n + m)_ | Easy | π | `KMP Algorithm`
3582 | [Generate Tag for Video Caption](https://leetcode.com/problems/generate-tag-for-video-caption/) | [C++](./C++/generate-tag-for-video-caption.cpp) [Python](./Python/generate-tag-for-video-caption.py) | _O(n)_ | _O(1)_ | Easy | | String
3598 | [Longest Common Prefix Between Adjacent Strings After Removals](https://leetcode.com/problems/longest-common-prefix-between-adjacent-strings-after-removals/) | [C++](./C++/longest-common-prefix-between-adjacent-strings-after-removals.cpp) [Python](./Python/longest-common-prefix-between-adjacent-strings-after-removals.py) | _O(n * l)_ | _O(n)_ | Medium | | LCP, Prefix Sum
3606 | [Coupon Code Validator](https://leetcode.com/problems/coupon-code-validator/) | [C++](./C++/coupon-code-validator.cpp) [Python](./Python/coupon-code-validator.py) | _O(l * nlogn)_ | _O(n * l)_ | Easy | | Hash Table, Sort
3744 | [Find Kth Character in Expanded String](https://leetcode.com/problems/find-kth-character-in-expanded-string/) | [C++](./C++/find-kth-character-in-expanded-string.cpp) [Python](./Python/find-kth-character-in-expanded-string.py) | _O(n)_ | _O(1)_ | Medium | π | String
3746 | [Minimum String Length After Balanced Removals](https://leetcode.com/problems/minimum-string-length-after-balanced-removals/) | [C++](./C++/minimum-string-length-after-balanced-removals.cpp) [Python](./Python/minimum-string-length-after-balanced-removals.py) | _O(n)_ | _O(1)_ | Medium | | String
3748 | [Count Stable Subarrays](https://leetcode.com/problems/count-stable-subarrays/) | [C++](./C++/count-stable-subarrays.cpp) [Python](./Python/count-stable-subarrays.py) | _O(n + q)_ | _O(n)_ | Hard | | Prefix Sum
3758 | [Convert Number Words to Digits](https://leetcode.com/problems/convert-number-words-to-digits/) | [C++](./C++/convert-number-words-to-digits.cpp) [Python](./Python/convert-number-words-to-digits.py) | _O(n)_ | _O(1)_ | Medium | π | String
3775 | [Reverse Words With Same Vowel Count](https://leetcode.com/problems/reverse-words-with-same-vowel-count/) | [C++](./C++/reverse-words-with-same-vowel-count.cpp) [Python](./Python/reverse-words-with-same-vowel-count.py) | _O(n)_ | _O(1)_ | Medium | | String, Inplace
3777 | [Minimum Deletions to Make Alternating Substring](https://leetcode.com/problems/minimum-deletions-to-make-alternating-substring/) | [C++](./C++/minimum-deletions-to-make-alternating-substring.cpp) [Python](./Python/minimum-deletions-to-make-alternating-substring.py) | _O((n + q) * logn)_ | _O(n)_ | Hard | | BIT, Fenwick Tree
3794 | [Reverse String Prefix](https://leetcode.com/problems/reverse-string-prefix/) | [C++](./C++/reverse-string-prefix.cpp) [Python](./Python/reverse-string-prefix.py) | _O(n)_ | _O(1)_ | Easy | | String
3813 | [Vowel-Consonant Score](https://leetcode.com/problems/vowel-consonant-score/) | [C++](./C++/vowel-consonant-score.cpp) [Python](./Python/vowel-consonant-score.py) | _O(n)_ | _O(1)_ | Easy | | String
3823 | [Reverse Letters Then Special Characters in a String](https://leetcode.com/problems/reverse-letters-then-special-characters-in-a-string/) | [C++](./C++/reverse-letters-then-special-characters-in-a-string.cpp) [Python](./Python/reverse-letters-then-special-characters-in-a-string.py) | _O(n)_ | _O(1)_ | Easy | | String
3838 | [Weighted Word Mapping](https://leetcode.com/problems/weighted-word-mapping/) | [C++](./C++/weighted-word-mapping.cpp) [Python](./Python/weighted-word-mapping.py) | _O(n * l)_ | _O(1)_ | Easy | | String
3856 | [Trim Trailing Vowels](https://leetcode.com/problems/trim-trailing-vowels/) | [C++](./C++/trim-trailing-vowels.cpp) [Python](./Python/trim-trailing-vowels.py) | _O(n)_ | _O(1)_ | Easy | | String
3860 | [Unique Email Groups](https://leetcode.com/problems/unique-email-groups/) | [C++](./C++/unique-email-groups.cpp) [Python](./Python/unique-email-groups.py) | _O(n * l)_ | _O(n * l)_ | Medium | π | String, Hash Table
3884 | [First Matching Character From Both Ends](https://leetcode.com/problems/first-matching-character-from-both-ends/) | [C++](./C++/first-matching-character-from-both-ends.cpp) [Python](./Python/first-matching-character-from-both-ends.py) | _O(n)_ | _O(1)_ | Medium | | String
3931 | [Check Adjacent Digit Differences](https://leetcode.com/problems/check-adjacent-digit-differences/) | [C++](./C++/check-adjacent-digit-differences.cpp) [Python](./Python/check-adjacent-digit-differences.py) | _O(n)_ | _O(1)_ | Easy | | String
3941 | [Password Strength](https://leetcode.com/problems/password-strength/) | [C++](./C++/password-strength.cpp) [Python](./Python/password-strength.py) | _O(n)_ | _O(1)_ | Medium | | String, Hash Table
3986 | [Number of Elapsed Seconds Between Two Times](https://leetcode.com/problems/number-of-elapsed-seconds-between-two-times/) | [C++](./C++/number-of-elapsed-seconds-between-two-times.cpp) [Python](./Python/number-of-elapsed-seconds-between-two-times.py) | _O(1)_ | _O(1)_ | Easy | | String
3999 | [Minimum Number of String Groups Through Transformations](https://leetcode.com/problems/minimum-number-of-string-groups-through-transformations/) | [C++](./C++/minimum-number-of-string-groups-through-transformations.cpp) [Python](./Python/minimum-number-of-string-groups-through-transformations.py) | _O(n * l)_ | _O(n * l)_ | Hard | | Hash Table, String
4030 | [Check ASCII Palindromic](https://leetcode.com/problems/check-ascii-palindromic/) | [C++](./C++/check-ascii-palindromic.cpp) [Python](./Python/check-ascii-palindromic.py) | _O(n)_ | _O(1)_ | Easy | | String, Bitmasks
4043 | [Count Rotations With Exactly K Equal Adjacent Pairs](https://leetcode.com/problems/count-rotations-with-exactly-k-equal-adjacent-pairs/) | [C++](./C++/count-rotations-with-exactly-k-equal-adjacent-pairs.cpp) [Python](./Python/count-rotations-with-exactly-k-equal-adjacent-pairs.py) | _O(n)_ | _O(1)_ | Easy | | String
4070 | [Minimum Rotations to Dial a Number I](https://leetcode.com/problems/minimum-rotations-to-dial-a-number-i/) | [C++](./C++/minimum-rotations-to-dial-a-number-i.cpp) [Python](./Python/minimum-rotations-to-dial-a-number-i.py) | _O(n)_ | _O(1)_ | Easy | | String
4071 | [Minimum Rotations to Dial a Number II](https://leetcode.com/problems/minimum-rotations-to-dial-a-number-ii/) | [C++](./C++/minimum-rotations-to-dial-a-number-ii.cpp) [Python](./Python/minimum-rotations-to-dial-a-number-ii.py) | _O(n)_ | _O(1)_ | Medium | | String
## Linked List
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
3062 | [Winner of the Linked List Game](https://leetcode.com/problems/winner-of-the-linked-list-game/) | [C++](./C++/winner-of-the-linked-list-game.cpp) [Python](./Python/winner-of-the-linked-list-game.py) | _O(n)_ | _O(1)_ | Easy | π | Linked List
3063 | [Linked List Frequency](https://leetcode.com/problems/linked-list-frequency/) | [C++](./C++/linked-list-frequency.cpp) [Python](./Python/linked-list-frequency.py) | _O(n)_ | _O(1)_ | Medium | π | Linked List
3217 | [Delete Nodes From Linked List Present in Array](https://leetcode.com/problems/delete-nodes-from-linked-list-present-in-array/) | [C++](./C++/delete-nodes-from-linked-list-present-in-array.cpp) [Python](./Python/delete-nodes-from-linked-list-present-in-array.py) | _O(n)_ | _O(m)_ | Medium | | Hash Table, Linked List
3263 | [Convert Doubly Linked List to Array I](https://leetcode.com/problems/convert-doubly-linked-list-to-array-i/) | [C++](./C++/convert-doubly-linked-list-to-array-i.cpp) [Python](./Python/convert-doubly-linked-list-to-array-i.py) | _O(n)_ | _O(1)_ | Easy | π | Linked List
3294 | [Convert Doubly Linked List to Array II](https://leetcode.com/problems/convert-doubly-linked-list-to-array-ii/) | [C++](./C++/convert-doubly-linked-list-to-array-ii.cpp) [Python](./Python/convert-doubly-linked-list-to-array-ii.py) | _O(n)_ | _O(1)_ | Medium | π | Linked List
## Stack
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
3113 | [Find the Number of Subarrays Where Boundary Elements Are Maximum](https://leetcode.com/problems/find-the-number-of-subarrays-where-boundary-elements-are-maximum/) | [C++](./C++/find-the-number-of-subarrays-where-boundary-elements-are-maximum.cpp) [Python](./Python/find-the-number-of-subarrays-where-boundary-elements-are-maximum.py) | _O(n)_ | _O(n)_ | Hard | | Mono Stack, Combinatorics
3174 | [Clear Digits](https://leetcode.com/problems/clear-digits/) | [C++](./C++/clear-digits.cpp) [Python](./Python/clear-digits.py) | _O(n)_ | _O(1)_ | Easy | | Stack, Two Pointers
3676 | [Count Bowl Subarrays](https://leetcode.com/problems/count-bowl-subarrays/) | [C++](./C++/count-bowl-subarrays.cpp) [Python](./Python/count-bowl-subarrays.py) | _O(n)_ | _O(n)_ | Medium | | Mono Stack
3703 | [Remove K-Balanced Substrings](https://leetcode.com/problems/remove-k-balanced-substrings/) | [C++](./C++/remove-k-balanced-substrings.cpp) [Python](./Python/remove-k-balanced-substrings.py) | _O(n)_ | _O(n)_ | Medium | | Stack
3749 | [Evaluate Valid Expressions](https://leetcode.com/problems/evaluate-valid-expressions/) | [C++](./C++/evaluate-valid-expressions.cpp) [Python](./Python/evaluate-valid-expressions.py) | _O(n)_ | _O(n)_ | Hard | π | Stack
3834 | [Merge Adjacent Equal Elements](https://leetcode.com/problems/merge-adjacent-equal-elements/) | [C++](./C++/merge-adjacent-equal-elements.cpp) [Python](./Python/merge-adjacent-equal-elements.py) | _O(n)_ | _O(1)_ | Medium | | Stack, Simulation
3878 | [Count Good Subarrays](https://leetcode.com/problems/count-good-subarrays/) | [C++](./C++/count-good-subarrays.cpp) [Python](./Python/count-good-subarrays.py) | _O(n)_ | _O(n)_ | Hard | | Combinatorics, Mono Stack
4054 | [Count Shadow Pairs I](https://leetcode.com/problems/count-shadow-pairs-i/) | [C++](./C++/count-shadow-pairs-i.cpp) [Python](./Python/count-shadow-pairs-i.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Mono Stack
4055 | [Count Shadow Pairs II](https://leetcode.com/problems/count-shadow-pairs-ii/) | [C++](./C++/count-shadow-pairs-ii.cpp) [Python](./Python/count-shadow-pairs-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | | Coordinate Compression, Merge Sort, Mono Stack
## Queue
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
## Binary Heap
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
3066 | [Minimum Operations to Exceed Threshold Value II](https://leetcode.com/problems/minimum-operations-to-exceed-threshold-value-ii/) | [C++](./C++/minimum-operations-to-exceed-threshold-value-ii.cpp) [Python](./Python/minimum-operations-to-exceed-threshold-value-ii.py) | _O(nlogn)_ | _O(n)_ | Medium | | Simulation, Heap
3080 | [Mark Elements on Array by Performing Queries](https://leetcode.com/problems/mark-elements-on-array-by-performing-queries/) | [C++](./C++/mark-elements-on-array-by-performing-queries.cpp) [Python](./Python/mark-elements-on-array-by-performing-queries.py) | _O(q + nlogn)_ | _O(n)_ | Medium | | Hash Table, Heap
3092 | [Most Frequent IDs](https://leetcode.com/problems/most-frequent-ids/) | [C++](./C++/most-frequent-ids.cpp) [Python](./Python/most-frequent-ids.py) | _O(nlogn)_ | _O(n)_ | Medium | | Heap, BST, Sorted List
3256 | [Maximum Value Sum by Placing Three Rooks I](https://leetcode.com/problems/maximum-value-sum-by-placing-three-rooks-i/) | [C++](./C++/maximum-value-sum-by-placing-three-rooks-i.cpp) [Python](./Python/maximum-value-sum-by-placing-three-rooks-i.py) | _O(m * n)_ | _O(m + n)_ | Hard | | Heap, Brute Force
3257 | [Maximum Value Sum by Placing Three Rooks II](https://leetcode.com/problems/maximum-value-sum-by-placing-three-rooks-ii/) | [C++](./C++/maximum-value-sum-by-placing-three-rooks-ii.cpp) [Python](./Python/maximum-value-sum-by-placing-three-rooks-ii.py) | _O(m * n)_ | _O(m + n)_ | Hard | | Heap, Brute Force
3275 | [K-th Nearest Obstacle Queries](https://leetcode.com/problems/k-th-nearest-obstacle-queries/) | [C++](./C++/k-th-nearest-obstacle-queries.cpp) [Python](./Python/k-th-nearest-obstacle-queries.py) | _O(qlogk)_ | _O(k)_ | Medium | | Heap
3684 | [Maximize Sum of At Most K Distinct Elements](https://leetcode.com/problems/maximize-sum-of-at-most-k-distinct-elements/) | [C++](./C++/maximize-sum-of-at-most-k-distinct-elements.cpp) [Python](./Python/maximize-sum-of-at-most-k-distinct-elements.py) | _O(nlogk)_ | _O(k)_ | Easy | | Heap, Sort
3691 | [Maximum Total Subarray Value II](https://leetcode.com/problems/maximum-total-subarray-value-ii/) | [C++](./C++/maximum-total-subarray-value-ii.cpp) [Python](./Python/maximum-total-subarray-value-ii.py) | _O((n + k) * logn)_ | _O(n)_ | Hard | | Heap, Sort, Two Pointers, RMQ, Sparse Table, Segment Tree
3781 | [Maximum Score After Binary Swaps](https://leetcode.com/problems/maximum-score-after-binary-swaps/) | [C++](./C++/maximum-score-after-binary-swaps.cpp) [Python](./Python/maximum-score-after-binary-swaps.py) | _O(nlogn)_ | _O(n)_ | Medium | | Heap
3962 | [Maximum Subarray Sum After at Most K Swaps](https://leetcode.com/problems/maximum-subarray-sum-after-at-most-k-swaps/) | [C++](./C++/maximum-subarray-sum-after-at-most-k-swaps.cpp) [Python](./Python/maximum-subarray-sum-after-at-most-k-swaps.py) | _O(n^2 * logk)_ | _O(n)_ | Hard | | Prefix Sum, Heap, DP
4004 | [Minimum Moves to Balance Circular Array II](https://leetcode.com/problems/minimum-moves-to-balance-circular-array-ii/) | [C++](./C++/minimum-moves-to-balance-circular-array-ii.cpp) [Python](./Python/minimum-moves-to-balance-circular-array-ii.py) | _O(n^2 * logn)_ | _O(n)_ | Hard | π, variant of [Codeforces Round #13 C](https://codeforces.com/contest/13/problem/C) | L1 Isotonic Regression, Heap, Greedy, Graph, Min-Cost Max-Flow, MCMF, Successive Shortest Path, SSP, `Dijkstra's Algorithm`, `Johnson Potential`
## Tree
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
3109 | [Find the Index of Permutation](https://leetcode.com/problems/find-the-index-of-permutation/)| [C++](./C++/find-the-index-of-permutation.cpp) [Python](./Python/find-the-index-of-permutation.py)| _O(nlogn)_ | _O(n)_ | Medium | π, variant of [Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) | BIT, Fenwick Tree, Combinatorics |
3515 | [Shortest Path in a Weighted Tree](https://leetcode.com/problems/shortest-path-in-a-weighted-tree/)| [C++](./C++/shortest-path-in-a-weighted-tree.cpp) [Python](./Python/shortest-path-in-a-weighted-tree.py)| _O(nlogn)_ | _O(n)_ | Hard | | BIT, Fenwick Tree, DFS |
3553 | [Minimum Weighted Subgraph With the Required Paths II](https://leetcode.com/problems/minimum-weighted-subgraph-with-the-required-paths-ii/)| [C++](./C++/minimum-weighted-subgraph-with-the-required-paths-ii.cpp) [Python](./Python/minimum-weighted-subgraph-with-the-required-paths-ii.py)| _O(n + q)_ | _O(n + q)_ | Hard | | Tree, DFS, `Tarjan's Offline LCA Algorithm` |
3558 | [Number of Ways to Assign Edge Weights I](https://leetcode.com/problems/number-of-ways-to-assign-edge-weights-i/)| [C++](./C++/number-of-ways-to-assign-edge-weights-i.cpp) [Python](./Python/number-of-ways-to-assign-edge-weights-i.py)| _O(n)_ | _O(n)_ | Medium | | Tree, BFS, Combinatorics |
3559 | [Number of Ways to Assign Edge Weights II](https://leetcode.com/problems/number-of-ways-to-assign-edge-weights-ii/)| [C++](./C++/number-of-ways-to-assign-edge-weights-ii.cpp) [Python](./Python/number-of-ways-to-assign-edge-weights-ii.py)| _O(n + q)_ | _O(n + q)_ | Medium | | Tree, DFS, `Tarjan's Offline LCA Algorithm`, Combinatorics |
3585 | [Find Weighted Median Node in Tree](https://leetcode.com/problems/find-weighted-median-node-in-tree/)| [C++](./C++/find-weighted-median-node-in-tree.cpp) [Python](./Python/find-weighted-median-node-in-tree.py)| _O(n + qlogh)_ | _O(n + q)_ | Hard | | Tree, DFS, `Tarjan's Offline LCA Algorithm`, Binary Search, Prefix Sum |
3715 | [Sum of Perfect Square Ancestors](https://leetcode.com/problems/sum-of-perfect-square-ancestors/)| [C++](./C++/sum-of-perfect-square-ancestors.cpp) [Python](./Python/sum-of-perfect-square-ancestors.py)| precompute: _O(r)_
runtime: _O(nlogx)_ | _O(r + n)_ | Hard | | Tree, Number Theory, `Linear Sieve of Eratosthenes`, Freq Table, DFS |
3841 | [Palindromic Path Queries in a Tree](https://leetcode.com/problems/palindromic-path-queries-in-a-tree/)| [C++](./C++/palindromic-path-queries-in-a-tree.cpp) [Python](./Python/palindromic-path-queries-in-a-tree.py)| _O((n + q) * logn)_ | _O(n)_ | Hard | | DFS, HLD, Heavy-Light Decomposition, LCA, Binary Lifting, BIT, Fenwick Tree |
3879 | [Maximum Distinct Path Sum in a Binary Tree](https://leetcode.com/problems/maximum-distinct-path-sum-in-a-binary-tree/)| [C++](./C++/maximum-distinct-path-sum-in-a-binary-tree.cpp) [Python](./Python/maximum-distinct-path-sum-in-a-binary-tree.py)| _O(n^2)_ | _O(n)_ | Medium | | DFS, BFS
3973 | [Distinct Gate Paths to LCA](https://leetcode.com/problems/distinct-gate-paths-to-lca/)| [C++](./C++/distinct-gate-paths-to-lca.cpp) [Python](./Python/distinct-gate-paths-to-lca.py)| _O(nlogn + qlogn)_ | _O(nlogn)_ | Hard | π | DFS, LCA, Binary Lifting
3997 | [Count Dominant Nodes in a Binary Tree](https://leetcode.com/problems/count-dominant-nodes-in-a-binary-tree/)| [C++](./C++/count-dominant-nodes-in-a-binary-tree.cpp) [Python](./Python/count-dominant-nodes-in-a-binary-tree.py)| _O(n)_ | _O(h)_ | Medium | | DFS
## Hash Table
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
3005 | [Count Elements With Maximum Frequency](https://leetcode.com/problems/count-elements-with-maximum-frequency/) | [C++](./C++/count-elements-with-maximum-frequency.cpp) [Python](./Python/count-elements-with-maximum-frequency.py) | _O(n)_ | _O(n)_ | Easy || Freq Table
3039 | [Apply Operations to Make String Empty](https://leetcode.com/problems/apply-operations-to-make-string-empty/) | [C++](./C++/apply-operations-to-make-string-empty.cpp) [Python](./Python/apply-operations-to-make-string-empty.py) | _O(n)_ | _O(1)_ | Medium || Freq Table
3044 | [Most Frequent Prime](https://leetcode.com/problems/most-frequent-prime/) | [C++](./C++/most-frequent-prime.cpp) [Python](./Python/most-frequent-prime.py) | precompute: _O(10^MAX_N_M)_
runtime: _O(n * m * (n + m))_ | _O(10^MAX_N_M + n * m * (n + m))_ | Medium || Number Theory, `Linear Sieve of Eratosthenes`, Freq Table
3046 | [Split the Array](https://leetcode.com/problems/split-the-array/) | [C++](./C++/split-the-array.cpp) [Python](./Python/split-the-array.py) | _O(n)_ | _O(n)_ | Easy || Freq Table
3078 | [Match Alphanumerical Pattern in Matrix I](https://leetcode.com/problems/match-alphanumerical-pattern-in-matrix-i/) | [C++](./C++/match-alphanumerical-pattern-in-matrix-i.cpp) [Python](./Python/match-alphanumerical-pattern-in-matrix-i.py) | _O(n * m * r * c)_ | _O(1)_ | Medium |π| Brute Force, Hash Table
3083 | [Existence of a Substring in a String and Its Reverse](https://leetcode.com/problems/existence-of-a-substring-in-a-string-and-its-reverse/) | [C++](./C++/existence-of-a-substring-in-a-string-and-its-reverse.cpp) [Python](./Python/existence-of-a-substring-in-a-string-and-its-reverse.py) | _O(n)_ | _O(min(n, 26^2))_ | Easy || Hash Table
3120 | [Count the Number of Special Characters I](https://leetcode.com/problems/count-the-number-of-special-characters-i/) | [C++](./C++/count-the-number-of-special-characters-i.cpp) [Python](./Python/count-the-number-of-special-characters-i.py) | _O(n + 26)_ | _O(26)_ | Easy || Hash Table
3121 | [Count the Number of Special Characters II](https://leetcode.com/problems/count-the-number-of-special-characters-ii/) | [C++](./C++/count-the-number-of-special-characters-ii.cpp) [Python](./Python/count-the-number-of-special-characters-ii.py) | _O(n + 26)_ | _O(26)_ | Medium || Hash Table
3137 | [Minimum Number of Operations to Make Word K-Periodic](https://leetcode.com/problems/minimum-number-of-operations-to-make-word-k-periodic/) | [C++](./C++/minimum-number-of-operations-to-make-word-k-periodic.cpp) [Python](./Python/minimum-number-of-operations-to-make-word-k-periodic.py) | _O(n)_ | _O(n)_ | Medium || Freq Table
3138 | [Minimum Length of Anagram Concatenation](https://leetcode.com/problems/minimum-length-of-anagram-concatenation/) | [C++](./C++/minimum-length-of-anagram-concatenation.cpp) [Python](./Python/minimum-length-of-anagram-concatenation.py) | _O(sqrt(n) * n + 26 * nlogn)_ | _O(26)_ | Medium || Number Theory, Freq Table
3143 | [Maximum Points Inside the Square](https://leetcode.com/problems/maximum-points-inside-the-square/) | [C++](./C++/maximum-points-inside-the-square.cpp) [Python](./Python/maximum-points-inside-the-square.py) | _O(n + 26)_ | _O(26)_ | Medium || Hash Table
3146 | [Permutation Difference between Two Strings](https://leetcode.com/problems/permutation-difference-between-two-strings/) | [C++](./C++/permutation-difference-between-two-strings.cpp) [Python](./Python/permutation-difference-between-two-strings.py) | _O(n + 26)_ | _O(26)_ | Easy || Hash Table
3158 | [Find the XOR of Numbers Which Appear Twice](https://leetcode.com/problems/find-the-xor-of-numbers-which-appear-twice/) | [C++](./C++/find-the-xor-of-numbers-which-appear-twice.cpp) [Python](./Python/find-the-xor-of-numbers-which-appear-twice.py) | _O(n)_ | _O(n)_ | Easy || Hash Table
3160 | [Find the Number of Distinct Colors Among the Balls](https://leetcode.com/problems/find-the-number-of-distinct-colors-among-the-balls/) | [C++](./C++/find-the-number-of-distinct-colors-among-the-balls.cpp) [Python](./Python/find-the-number-of-distinct-colors-among-the-balls.py) | _O(q)_ | _O(q)_ | Medium || Freq Table
3167 | [Better Compression of String](https://leetcode.com/problems/better-compression-of-string/) | [C++](./C++/better-compression-of-string.cpp) [Python](./Python/better-compression-of-string.py) | _O(n + 26)_ | _O(26)_ | Medium | π | Freq Table, Counting Sort
3184 | [Count Pairs That Form a Complete Day I](https://leetcode.com/problems/count-pairs-that-form-a-complete-day-i/) | [C++](./C++/count-pairs-that-form-a-complete-day-i.cpp) [Python](./Python/count-pairs-that-form-a-complete-day-i.py) | _O(n + 24)_ | _O(24)_ | Easy | | Freq Table
3185 | [Count Pairs That Form a Complete Day II](https://leetcode.com/problems/count-pairs-that-form-a-complete-day-ii/) | [C++](./C++/count-pairs-that-form-a-complete-day-ii.cpp) [Python](./Python/count-pairs-that-form-a-complete-day-ii.py) | _O(n + 24)_ | _O(24)_ | Medium | | Freq Table
3223 | [Minimum Length of String After Operations](https://leetcode.com/problems/minimum-length-of-string-after-operations/) | [C++](./C++/minimum-length-of-string-after-operations.cpp) [Python](./Python/minimum-length-of-string-after-operations.py) | _O(n + 26)_ | _O(26)_ | Medium | | Freq Table
3237 | [Alt and Tab Simulation](https://leetcode.com/problems/alt-and-tab-simulation/) | [C++](./C++/alt-and-tab-simulation.cpp) [Python](./Python/alt-and-tab-simulation.py) | _O(n)_ | _O(n)_ | Medium | π | Hash Table
3238 | [Find the Number of Winning Players](https://leetcode.com/problems/find-the-number-of-winning-players/) | [C++](./C++/find-the-number-of-winning-players.cpp) [Python](./Python/find-the-number-of-winning-players.py) | _O(p)_ | _O(min(n * c, p)_ | Easy | | Freq Table
3245 | [Alternating Groups III](https://leetcode.com/problems/alternating-groups-iii/) | [C++](./C++/alternating-groups-iii.cpp) [Python](./Python/alternating-groups-iii.py) | _O(nlogn + qlogn)_ | _O(n)_ | Hard | | BST, Sorted List, Freq Table, BIT, Fenwick Tree
3295 | [Report Spam Message](https://leetcode.com/problems/report-spam-message/) | [C++](./C++/report-spam-message.cpp) [Python](./Python/report-spam-message.py) | _O(n + m)_ | _O(m)_ | Medium | | Hash Table
3365 | [Rearrange K Substrings to Form Target String](https://leetcode.com/problems/rearrange-k-substrings-to-form-target-string/) | [C++](./C++/rearrange-k-substrings-to-form-target-string.cpp) [Python](./Python/rearrange-k-substrings-to-form-target-string.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table
3371 | [Identify the Largest Outlier in an Array](https://leetcode.com/problems/identify-the-largest-outlier-in-an-array/) | [C++](./C++/identify-the-largest-outlier-in-an-array.cpp) [Python](./Python/identify-the-largest-outlier-in-an-array.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table
3396 | [Minimum Number of Operations to Make Elements in Array Distinct](https://leetcode.com/problems/minimum-number-of-operations-to-make-elements-in-array-distinct/) | [C++](./C++/minimum-number-of-operations-to-make-elements-in-array-distinct.cpp) [Python](./Python/minimum-number-of-operations-to-make-elements-in-array-distinct.py) | _O(n + r)_ | _O(r)_ | Easy | | Freq Table
3404 | [Count Special Subsequences](https://leetcode.com/problems/count-special-subsequences/) | [C++](./C++/count-special-subsequences.cpp) [Python](./Python/count-special-subsequences.py) | _O(n^2)_ | _O(n^2)_ | Medium | | Freq Table, Number Theory
3438 | [Find Valid Pair of Adjacent Digits in String](https://leetcode.com/problems/find-valid-pair-of-adjacent-digits-in-string/) | [C++](./C++/find-valid-pair-of-adjacent-digits-in-string.cpp) [Python](./Python/find-valid-pair-of-adjacent-digits-in-string.py) | _O(n)_ | _O(1)_ | Easy | | Freq Table
3442 | [Maximum Difference Between Even and Odd Frequency I](https://leetcode.com/problems/maximum-difference-between-even-and-odd-frequency-i/) | [C++](./C++/maximum-difference-between-even-and-odd-frequency-i.cpp) [Python](./Python/maximum-difference-between-even-and-odd-frequency-i.py) | _O(n + 26)_ | _O(26)_ | Easy | | Freq Table
3450 | [Maximum Students on a Single Bench](https://leetcode.com/problems/maximum-students-on-a-single-bench/) | [C++](./C++/maximum-students-on-a-single-bench.cpp) [Python](./Python/maximum-students-on-a-single-bench.py) | _O(n)_ | _O(n)_ | Easy | π | Hash Table, Unordered Set
3471 | [Find the Largest Almost Missing Integer](https://leetcode.com/problems/find-the-largest-almost-missing-integer/) | [C++](./C++/find-the-largest-almost-missing-integer.cpp) [Python](./Python/find-the-largest-almost-missing-integer.py) | _O(n)_ | _O(n)_ | Easy | | Freq Table
3487 | [Maximum Unique Subarray Sum After Deletion](https://leetcode.com/problems/maximum-unique-subarray-sum-after-deletion/) | [C++](./C++/maximum-unique-subarray-sum-after-deletion.cpp) [Python](./Python/maximum-unique-subarray-sum-after-deletion.py) | _O(n)_ | _O(n)_ | Easy | | Hash Table
3488 | [Closest Equal Element Queries](https://leetcode.com/problems/closest-equal-element-queries/) | [C++](./C++/closest-equal-element-queries.cpp) [Python](./Python/closest-equal-element-queries.py) | _O(n)_ | _O(n)_ | Medium | | Hash Table
3527 | [Find the Most Common Response](https://leetcode.com/problems/find-the-most-common-response/) | [C++](./C++/find-the-most-common-response.cpp) [Python](./Python/find-the-most-common-response.py) | _O(n * l)_ | _O(n * l)_ | Medium | | Hash Table, Freq Table
3541 | [Find Most Frequent Vowel and Consonant](https://leetcode.com/problems/find-most-frequent-vowel-and-consonant/) | [C++](./C++/find-most-frequent-vowel-and-consonant.cpp) [Python](./Python/find-most-frequent-vowel-and-consonant.py) | _O(n + 26)_ | _O(26)_ | Easy | | Freq Table
3572 | [Maximize YβSum by Picking a Triplet of Distinct XβValues](https://leetcode.com/problems/maximize-ysum-by-picking-a-triplet-of-distinct-xvalues/) | [C++](./C++/maximize-ysum-by-picking-a-triplet-of-distinct-xvalues.cpp) [Python](./Python/maximize-ysum-by-picking-a-triplet-of-distinct-xvalues.py) | _O(n)_ | _O(n)_ | Medium | | Hash Table, Quick Select
3581 | [Count Odd Letters from Number](https://leetcode.com/problems/count-odd-letters-from-number/) | [C++](./C++/count-odd-letters-from-number.cpp) [Python](./Python/count-odd-letters-from-number.py) | _O(logn)_ | _O(26)_ | Easy |π| Freq Table
3591 | [Check if Any Element Has Prime Frequency](https://leetcode.com/problems/check-if-any-element-has-prime-frequency/) | [C++](./C++/check-if-any-element-has-prime-frequency.cpp) [Python](./Python/check-if-any-element-has-prime-frequency.py) | precompute: _O(MAX_N)_
runtime: _O(n)_ | _O(MAX_N)_ | Easy || Freq Table, Number Theory, `Linear Sieve of Eratosthenes`
3636 | [Threshold Majority Queries](https://leetcode.com/problems/threshold-majority-queries/) | [C++](./C++/threshold-majority-queries.cpp) [Python](./Python/threshold-majority-queries.py) | _O(nlogn + qlogq + (n + q) * sqrt(n) * logn)_ | _O(q + n)_ | Hard || Sort, Coordinate Compression, Sqrt Decomposition, `Mo's Algorithm`, Freq Table, Sorted List, BST
3662 | [Filter Characters by Frequency](https://leetcode.com/problems/filter-characters-by-frequency/) | [C++](./C++/filter-characters-by-frequency.cpp) [Python](./Python/filter-characters-by-frequency.py) | _O(n + 26)_ | _O(26)_ | Easy |π| Freq Table
3663 | [Find The Least Frequent Digit](https://leetcode.com/problems/find-the-least-frequent-digit/) | [C++](./C++/find-the-least-frequent-digit.cpp) [Python](./Python/find-the-least-frequent-digit.py) | _O(logn + 10)_ | _O(10)_ | Easy | | Freq Table
3668 | [Restore Finishing Order](https://leetcode.com/problems/restore-finishing-order/) | [C++](./C++/restore-finishing-order.cpp) [Python](./Python/restore-finishing-order.py) | _O(n + min(8, n))_ | _O(min(8, n))_ | Easy | | Hash Table
3678 | [Smallest Absent Positive Greater Than Average](https://leetcode.com/problems/smallest-absent-positive-greater-than-average/) | [C++](./C++/smallest-absent-positive-greater-than-average.cpp) [Python](./Python/smallest-absent-positive-greater-than-average.py) | _O(n)_ | _O(n)_ | Easy | | Hash Table
3682 | [Minimum Index Sum of Common Elements](https://leetcode.com/problems/minimum-index-sum-of-common-elements/) | [C++](./C++/minimum-index-sum-of-common-elements.cpp) [Python](./Python/minimum-index-sum-of-common-elements.py) | _O(n + m)_ | _O(n)_ | Medium | π | Hash Table
3692 | [Majority Frequency Characters](https://leetcode.com/problems/majority-frequency-characters/) | [C++](./C++/majority-frequency-characters.cpp) [Python](./Python/majority-frequency-characters.py) | _O(n + 26)_ | _O(26)_ | Easy | | Freq Table
3694 | [Distinct Points Reachable After Substring Removal](https://leetcode.com/problems/distinct-points-reachable-after-substring-removal/) | [C++](./C++/distinct-points-reachable-after-substring-removal.cpp) [Python](./Python/distinct-points-reachable-after-substring-removal.py) | _O(n)_ | _O(n)_ | Medium | | Hash Table
3712 | [Sum of Elements With Frequency Divisible by K](https://leetcode.com/problems/sum-of-elements-with-frequency-divisible-by-k/) | [C++](./C++/sum-of-elements-with-frequency-divisible-by-k.cpp) [Python](./Python/sum-of-elements-with-frequency-divisible-by-k.py) | _O(n)_ | _O(n)_ | Easy | | Freq Table
3713 | [Longest Balanced Substring I](https://leetcode.com/problems/longest-balanced-substring-i/) | [C++](./C++/longest-balanced-substring-i.cpp) [Python](./Python/longest-balanced-substring-i.py) | _O(n * (a + n))_ | _O(a)_ | Medium | | Freq Table
3714 | [Longest Balanced Substring II](https://leetcode.com/problems/longest-balanced-substring-ii/) | [C++](./C++/longest-balanced-substring-ii.cpp) [Python](./Python/longest-balanced-substring-ii.py) | _O(n)_ | _O(n)_ | Medium | | Hash Table, Prefix Sum
3718 | [Smallest Missing Multiple of K](https://leetcode.com/problems/smallest-missing-multiple-of-k/) | [C++](./C++/smallest-missing-multiple-of-k.cpp) [Python](./Python/smallest-missing-multiple-of-k.py) | _O(n)_ | _O(n)_ | Easy | | Hash Table
3728 | [Stable Subarrays With Equal Boundary and Interior Sum](https://leetcode.com/problems/stable-subarrays-with-equal-boundary-and-interior-sum/) | [C++](./C++/stable-subarrays-with-equal-boundary-and-interior-sum.cpp) [Python](./Python/stable-subarrays-with-equal-boundary-and-interior-sum.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Prefix Sum
3729 | [Count Distinct Subarrays Divisible by K in Sorted Array](https://leetcode.com/problems/count-distinct-subarrays-divisible-by-k-in-sorted-array/) | [C++](./C++/count-distinct-subarrays-divisible-by-k-in-sorted-array.cpp) [Python](./Python/count-distinct-subarrays-divisible-by-k-in-sorted-array.py) | _O(n)_ | _O(min(n, k))_ | Hard | | Freq Table, Prefix Sum
3755 | [Find Maximum Balanced XOR Subarray Length](https://leetcode.com/problems/find-maximum-balanced-xor-subarray-length/) | [C++](./C++//find-maximum-balanced-xor-subarray-length.cpp) [Python](./Python/find-maximum-balanced-xor-subarray-length.py) | _O(n)_ | _O(n)_ | Medium | | Hash Table, Prefix Sum
3760 | [Maximum Substrings With Distinct Start](https://leetcode.com/problems/maximum-substrings-with-distinct-start/) | [C++](./C++/maximum-substrings-with-distinct-start.cpp) [Python](./Python/maximum-substrings-with-distinct-start.py) | _O(n + 26)_ | _O(26)_ | Medium | | Hash Table
3761 | [Minimum Absolute Distance Between Mirror Pairs](https://leetcode.com/problems/minimum-absolute-distance-between-mirror-pairs/) | [C++](./C++/minimum-absolute-distance-between-mirror-pairs.cpp) [Python](./Python/minimum-absolute-distance-between-mirror-pairs.py) | _O(nlogr)_ | _O(n)_ | Medium | | Hash Table
3773 | [Maximum Number of Equal Length Runs](https://leetcode.com/problems/maximum-number-of-equal-length-runs/) | [C++](./C++/maximum-number-of-equal-length-runs.cpp) [Python](./Python/maximum-number-of-equal-length-runs.py) | _O(n)_ | _O(sqrt(n))_ | Medium | π | Freq Table
3779 | [Minimum Number of Operations to Have Distinct Elements](https://leetcode.com/problems/minimum-number-of-operations-to-have-distinct-elements/) | [C++](./C++/minimum-number-of-operations-to-have-distinct-elements.cpp) [Python](./Python/minimum-number-of-operations-to-have-distinct-elements.py) | _O(n)_ | _O(n)_ | Medium | | Hash Table
3784 | [Minimum Deletion Cost to Make All Characters Equal](https://leetcode.com/problems/minimum-deletion-cost-to-make-all-characters-equal/) | [C++](./C++/minimum-deletion-cost-to-make-all-characters-equal.cpp) [Python](./Python/minimum-deletion-cost-to-make-all-characters-equal.py) | _O(n + 26)_ | _O(26)_ | Medium | | Freq Table
3803 | [Count Residue Prefixes](https://leetcode.com/problems/count-residue-prefixes/) | [C++](./C++/count-residue-prefixes.cpp) [Python](./Python/count-residue-prefixes.py) | _O(n + 26)_ | _O(26)_ | Easy | | Hash Table
3804 | [Number of Centered Subarrays](https://leetcode.com/problems/number-of-centered-subarrays/) | [C++](./C++/number-of-centered-subarrays.cpp) [Python](./Python/number-of-centered-subarrays.py) | _O(n^2)_ | _O(n)_ | Medium | | Hash Table
3805 | [Count Caesar Cipher Pairs](https://leetcode.com/problems/count-caesar-cipher-pairs/) | [C++](./C++/count-caesar-cipher-pairs.cpp) [Python](./Python/count-caesar-cipher-pairs.py) | _O(n * m)_ | _O(n * m)_ | Medium | | Freq Table
3810 | [Minimum Operations to Reach Target Array](https://leetcode.com/problems/minimum-operations-to-reach-target-array/) | [C++](./C++/minimum-operations-to-reach-target-array.cpp) [Python](./Python/minimum-operations-to-reach-target-array.py) | _O(n)_ | _O(n)_ | Medium | | Hash Table
3837 | [Delayed Count of Equal Elements](https://leetcode.com/problems/delayed-count-of-equal-elements/) | [C++](./C++/delayed-count-of-equal-elements.cpp) [Python](./Python/delayed-count-of-equal-elements.py) | _O(n)_ | _O(n)_ | Medium | π | Freq Table
3839 | [Number of Prefix Connected Groups](https://leetcode.com/problems/number-of-prefix-connected-groups/) | [C++](./C++/number-of-prefix-connected-groups.cpp) [Python](./Python/number-of-prefix-connected-groups.py) | _O(n * k)_ | _O(n * k)_ | Medium | | Freq Table
3842 | [Toggle Light Bulbs](https://leetcode.com/problems/toggle-light-bulbs/) | [C++](./C++/toggle-light-bulbs.cpp) [Python](./Python/toggle-light-bulbs.py) | _O(n + r)_ | _O(r)_ | Easy | | Freq Table, Sort
3843 | [First Element with Unique Frequency](https://leetcode.com/problems/first-element-with-unique-frequency/) | [C++](./C++/first-element-with-unique-frequency.cpp) [Python](./Python/first-element-with-unique-frequency.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table
3846 | [Total Distance to Type a String Using One Finger](https://leetcode.com/problems/total-distance-to-type-a-string-using-one-finger/) | [C++](./C++/total-distance-to-type-a-string-using-one-finger.cpp) [Python](./Python/total-distance-to-type-a-string-using-one-finger.py) | _O(n)_ | _O(n)_ | Medium | π | Hash Table
3848 | [Check Digitorial Permutation](https://leetcode.com/problems/check-digitorial-permutation/) | [C++](./C++/check-digitorial-permutation.cpp) [Python](./Python/check-digitorial-permutation.py) | _O(logn + 10)_ | _O(10)_ | Medium | | Freq Table
3852 | [Smallest Pair With Different Frequencies](https://leetcode.com/problems/smallest-pair-with-different-frequencies/) | [C++](./C++/smallest-pair-with-different-frequencies.cpp) [Python](./Python/smallest-pair-with-different-frequencies.py) | _O(n)_ | _O(n)_ | Easy | | Freq Table
3866 | [First Unique Even Element](https://leetcode.com/problems/first-unique-even-element/) | [C++](./C++/first-unique-even-element.cpp) [Python](./Python/first-unique-even-element.py) | _O(n)_ | _O(n)_ | Easy | | Freq Table
3889 | [Mirror Frequency Distance](https://leetcode.com/problems/mirror-frequency-distance/) | [C++](./C++/mirror-frequency-distance.cpp) [Python](./Python/mirror-frequency-distance.py) | _O(n + 36)_ | _O(36)_ | Medium| | Freq Table
3890 | [Integers With Multiple Sum of Two Cubes](https://leetcode.com/problems/integers-with-multiple-sum-of-two-cubes/) | [C++](./C++/integers-with-multiple-sum-of-two-cubes.cpp) [Python](./Python/integers-with-multiple-sum-of-two-cubes.py) | _O(n^(2/3) * logn)_ | _O(n^(2/3))_ | Medium| | Brute Force, Freq Table, Sort
3900 | [Longest Balanced Substring After One Swap](https://leetcode.com/problems/longest-balanced-substring-after-one-swap/) |[C++](./C++/longest-balanced-substring-after-one-swap.cpp) [Python](./Python/longest-balanced-substring-after-one-swap.py) | _O(n)_ | _O(n)_ | Medium | variant of [Contiguous Array](https://leetcode.com/problems/contiguous-array/) | Hash Table
3901 | [Good Subsequence Queries](https://leetcode.com/problems/good-subsequence-queries/) |[C++](./C++/good-subsequence-queries.cpp) [Python](./Python/good-subsequence-queries.py) | precompute: _O(rlog(logr))_
runtime: _O(r + n + q)_ | _O(rlog(logr) + n)_ | Medium | | Number Theory, Freq Table
3913 | [Sort Vowels by Frequency](https://leetcode.com/problems/sort-vowels-by-frequency/) |[C++](./C++/sort-vowels-by-frequency.cpp) [Python](./Python/sort-vowels-by-frequency.py) | _O(n)_ | _O(1)_ | Medium | | Freq Table, Sort
3917 | [Count Indices With Opposite Parity](https://leetcode.com/problems/count-indices-with-opposite-parity/) |[C++](./C++/count-indices-with-opposite-parity.cpp) [Python](./Python/count-indices-with-opposite-parity.py) | _O(n)_ | _O(1)_ | Easy | | Freq Table
3921 | [Score Validator](https://leetcode.com/problems/score-validator/) |[C++](./C++/score-validator.cpp) [Python](./Python/score-validator.py) | _O(n)_ | _O(1)_ | Easy | | Freq Table
3926 | [Count Valid Word Occurrences](https://leetcode.com/problems/count-valid-word-occurrences/) |[C++](./C++/count-valid-word-o