AI prompts
base on šļø Python / Modern C++ Solutions of All 3390 LeetCode Problems (Weekly Update) # [LeetCode](https://leetcode.com/problemset/all/)
![Language](https://img.shields.io/badge/language-Python%20%2F%20Modern%20C++-orange.svg)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)
![Update](https://img.shields.io/badge/update-weekly-green.svg)
![Progress](https://img.shields.io/badge/progress-3390%20%2F%203390-ff69b4.svg)
[![SayThanks](https://img.shields.io/badge/say-thanks-ff69f4.svg)](https://saythanks.io/to/kamyu104)
![Visitors](https://visitor-badge.laobi.icu/badge?page_id=kamyu104.leetcode.solutions)
* 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-2024) 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)
## 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|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2151 | [Maximum Good People Based on Statements](https://leetcode.com/problems/maximum-good-people-based-on-statements/) | [C++](./C++/maximum-good-people-based-on-statements.cpp) [Python](./Python/maximum-good-people-based-on-statements.py) | _O(n^2 * 2^n)_ | _O(1)_ | Hard || Bitmasks, Brute Force
2212 | [Maximum Points in an Archery Competition](https://leetcode.com/problems/maximum-points-in-an-archery-competition/) | [C++](./C++/maximum-points-in-an-archery-competition.cpp) [Python](./Python/maximum-points-in-an-archery-competition.py) | _O(n * 2^n)_ | _O(n)_ | Medium || Bitmasks, Brute Force
2220 | [Minimum Bit Flips to Convert Number](https://leetcode.com/problems/minimum-bit-flips-to-convert-number/) | [C++](./C++/minimum-bit-flips-to-convert-number.cpp) [Python](./Python/minimum-bit-flips-to-convert-number.py) | _O(logn)_ | _O(1)_ | Easy || Bit Manipulation
2275 | [Largest Combination With Bitwise AND Greater Than Zero](https://leetcode.com/problems/largest-combination-with-bitwise-and-greater-than-zero/) | [C++](./C++/largest-combination-with-bitwise-and-greater-than-zero.cpp) [Python](./Python/largest-combination-with-bitwise-and-greater-than-zero.py) | _O(nlogr)_ | _O(logr)_ | Medium || Bit Manipulation, Freq Table
2317 | [Maximum XOR After Operations](https://leetcode.com/problems/maximum-xor-after-operations/) | [C++](./C++/maximum-xor-after-operations.cpp) [Python](./Python/maximum-xor-after-operations.py) | _O(n)_ | _O(1)_ | Medium || Bit Manipulation, Greedy
2397 | [Maximum Rows Covered by Columns](https://leetcode.com/problems/maximum-rows-covered-by-columns/) | [C++](./C++/maximum-rows-covered-by-columns.cpp) [Python](./Python/maximum-rows-covered-by-columns.py) | _O(m * n + m * C(n, k))_ | _O(m)_ | Medium || Bitmasks, `Hakmem Item 175`
2411 | [Smallest Subarrays With Maximum Bitwise OR](https://leetcode.com/problems/smallest-subarrays-with-maximum-bitwise-or/) | [C++](./C++/smallest-subarrays-with-maximum-bitwise-or.cpp) [Python](./Python/smallest-subarrays-with-maximum-bitwise-or.py) | _O(n)_ | _O(1)_ | Medium || Bitmasks, Hash Table
2419 | [Longest Subarray With Maximum Bitwise AND](https://leetcode.com/problems/longest-subarray-with-maximum-bitwise-and/) | [C++](./C++/longest-subarray-with-maximum-bitwise-and.cpp) [Python](./Python/longest-subarray-with-maximum-bitwise-and.py) | _O(n)_ | _O(1)_ | Medium || Bit Manipulation
2425 | [Bitwise XOR of All Pairings](https://leetcode.com/problems/bitwise-xor-of-all-pairings/) | [C++](./C++/bitwise-xor-of-all-pairings.cpp) [Python](./Python/bitwise-xor-of-all-pairings.py) | _O(n)_ | _O(1)_ | Medium || Bit Manipulation
2429 | [Minimize XOR](https://leetcode.com/problems/minimize-xor/) | [C++](./C++/minimize-xor.cpp) [Python](./Python/minimize-xor.py) | _O(logn)_ | _O(1)_ | Medium || Bit Manipulation, Greedy
2505 | [Bitwise OR of All Subsequence Sums](https://leetcode.com/problems/bitwise-or-of-all-subsequence-sums/) | [C++](./C++/bitwise-or-of-all-subsequence-sums.cpp) [Python](./Python/bitwise-or-of-all-subsequence-sums.py) | _O(n)_ | _O(1)_ | Medium |š| Bit Manipulation
2527 | [Find Xor-Beauty of Array](https://leetcode.com/problems/find-xor-beauty-of-array/) | [C++](./C++/find-xor-beauty-of-array.cpp) [Python](./Python/find-xor-beauty-of-array.py) | _O(n)_ | _O(1)_ | Medium | | Bit Manipulation, Math
2595 | [Number of Even and Odd Bits](https://leetcode.com/problems/number-of-even-and-odd-bits/) | [C++](./C++/number-of-even-and-odd-bits.cpp) [Python](./Python/number-of-even-and-odd-bits.py) | _O(1)_ | _O(1)_ | Easy | | Bit Manipulation
2859 | [Sum of Values at Indices With K Set Bits](https://leetcode.com/problems/sum-of-values-at-indices-with-k-set-bits/) | [C++](./C++/sum-of-values-at-indices-with-k-set-bits.cpp) [Python](./Python/sum-of-values-at-indices-with-k-set-bits.py) | _O(C(ceil(log2(n)), k))_ | _O(1)_ | Easy | | Bitmasks, `Hakmem Item 175`
2917 | [Find the K-or of an Array](https://leetcode.com/problems/find-the-k-or-of-an-array/) | [C++](./C++/find-the-k-or-of-an-array.cpp) [Python](./Python/find-the-k-or-of-an-array.py) | _O(nlogr)_ | _O(1)_ | Easy | | Bit Manipulation
2932 | [Maximum Strong Pair XOR I](https://leetcode.com/problems/maximum-strong-pair-xor-i/) | [C++](./C++/maximum-strong-pair-xor-i.cpp) [Python](./Python/maximum-strong-pair-xor-i.py) | _O(nlogr)_ | _O(t)_ | Easy | variant of [Maximum XOR of Two Numbers in an Array](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/) | Bit Manipulation, Greedy, Trie, DP, Sort, Two Pointers, Brute Force
2935 | [Maximum Strong Pair XOR II](https://leetcode.com/problems/maximum-strong-pair-xor-ii/) | [C++](./C++/maximum-strong-pair-xor-ii.cpp) [Python](./Python/maximum-strong-pair-xor-ii.py) | _O(nlogr)_ | _O(t)_ | Hard | variant of [Maximum XOR of Two Numbers in an Array](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/) | Bit Manipulation, Greedy, Trie, DP, Sort, Two Pointers
2980 | [Check if Bitwise OR Has Trailing Zeros](https://leetcode.com/problems/check-if-bitwise-or-has-trailing-zeros/) | [C++](./C++/check-if-bitwise-or-has-trailing-zeros.cpp) [Python](./Python/check-if-bitwise-or-has-trailing-zeros.py) | _O(n)_ | _O(1)_ | Easy | | Bit Manipulation
2997 | [Minimum Number of Operations to Make Array XOR Equal to K](https://leetcode.com/problems/minimum-number-of-operations-to-make-array-xor-equal-to-k/) | [C++](./C++/minimum-number-of-operations-to-make-array-xor-equal-to-k.cpp) [Python](./Python/minimum-number-of-operations-to-make-array-xor-equal-to-k.py) | _O(n)_ | _O(1)_ | Medium | | Bit Manipulation
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))<br>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
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Array
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2007 | [Find Original Array From Doubled Array](https://leetcode.com/problems/find-original-array-from-doubled-array/) | [C++](./C++/find-original-array-from-doubled-array.cpp) [Python](./Python/find-original-array-from-doubled-array.py) | _O(n + klogk)_ | _O(k)_ | Medium | variant of [Array of Doubled Pairs](https://leetcode.com/problems/array-of-doubled-pairs/) |
2011 | [Final Value of Variable After Performing Operations](https://leetcode.com/problems/final-value-of-variable-after-performing-operations/) | [C++](./C++/final-value-of-variable-after-performing-operations.cpp) [Python](./Python/final-value-of-variable-after-performing-operations.py) | _O(n)_ | _O(1)_ | Easy | |
2012 | [Sum of Beauty in the Array](https://leetcode.com/problems/sum-of-beauty-in-the-array/) | [C++](./C++/sum-of-beauty-in-the-array.cpp) [Python](./Python/sum-of-beauty-in-the-array.py) | _O(n)_ | _O(n)_ | Medium || Prefix Sum
2016 | [Maximum Difference Between Increasing Elements](https://leetcode.com/problems/maximum-difference-between-increasing-elements/)| [C++](./C++/maximum-difference-between-increasing-elements.cpp) [Python](./Python/maximum-difference-between-increasing-elements.py) | _O(n)_ | _O(1)_ | Easy | variant of [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) |
2017 | [Grid Game](https://leetcode.com/problems/grid-game/) | [C++](./C++/grid-game.cpp) [Python](./Python/grid-game.py) | _O(n)_ | _O(1)_ | Medium || Prefix Sum
2018 | [Check if Word Can Be Placed In Crossword](https://leetcode.com/problems/check-if-word-can-be-placed-in-crossword/) | [C++](./C++/check-if-word-can-be-placed-in-crossword.cpp) [Python](./Python/check-if-word-can-be-placed-in-crossword.py) | _O(m * n)_ | _O(1)_ | Medium ||
2022 | [Convert 1D Array Into 2D Array](https://leetcode.com/problems/convert-1d-array-into-2d-array/) | [C++](./C++/convert-1d-array-into-2d-array.cpp) [Python](./Python/convert-1d-array-into-2d-array.py) | _O(m * n)_ | _O(1)_ | Easy ||
2033 | [Minimum Operations to Make a Uni-Value Grid](https://leetcode.com/problems/minimum-operations-to-make-a-uni-value-grid/) | [C++](./C++/minimum-operations-to-make-a-uni-value-grid.cpp) [Python](./Python/minimum-operations-to-make-a-uni-value-grid.py) | _O(m * n)_ on average | _O(m * n)_ | Medium | variant of [Minimum Moves to Equal Array Elements II](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/) | Math, Median, Quick Select
2035 | [Partition Array Into Two Arrays to Minimize Sum Difference](https://leetcode.com/problems/partition-array-into-two-arrays-to-minimize-sum-difference/) | [C++](./C++/partition-array-into-two-arrays-to-minimize-sum-difference.cpp) [Python](./Python/partition-array-into-two-arrays-to-minimize-sum-difference.py) | _O(n * 2^n)_ | _O(2^n)_ | Hard || Meet in the Middle
2038 | [Remove Colored Pieces if Both Neighbors are the Same Color](https://leetcode.com/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color/) | [C++](./C++/remove-colored-pieces-if-both-neighbors-are-the-same-color.cpp) [Python](./Python/remove-colored-pieces-if-both-neighbors-are-the-same-color.py) | _O(n)_ | _O(1)_ | Medium ||
2055 | [Plates Between Candles](https://leetcode.com/problems/plates-between-candles/) | [C++](./C++/plates-between-candles.cpp) [Python](./Python/plates-between-candles.py) | _O(n + q)_ | _O(n)_ | Medium || Prefix Sum
2057 | [Smallest Index With Equal Value](https://leetcode.com/problems/smallest-index-with-equal-value/) | [C++](./C++/smallest-index-with-equal-value.cpp) [Python](./Python/smallest-index-with-equal-value.py) | _O(n)_ | _O(1)_ | Easy ||
2075 | [Decode the Slanted Ciphertext](https://leetcode.com/problems/decode-the-slanted-ciphertext/) | [C++](./C++/decode-the-slanted-ciphertext.cpp) [Python](./Python/decode-the-slanted-ciphertext.py) | _O(n)_ | _O(1)_ | Medium ||
2078 | [Two Furthest Houses With Different Colors](https://leetcode.com/problems/two-furthest-houses-with-different-colors/) | [C++](./C++/two-furthest-houses-with-different-colors.cpp) [Python](./Python/two-furthest-houses-with-different-colors.py) | _O(n)_ | _O(1)_ | Easy ||
2079 | [Watering Plants](https://leetcode.com/problems/watering-plants/) | [C++](./C++/watering-plants.cpp) [Python](./Python/watering-plants.py) | _O(n)_ | _O(1)_ | Medium ||
2098 | [Subsequence of Size K With the Largest Even Sum](https://leetcode.com/problems/subsequence-of-size-k-with-the-largest-even-sum/) | [C++](./C++/subsequence-of-size-k-with-the-largest-even-sum.cpp) [Python](./Python/subsequence-of-size-k-with-the-largest-even-sum.py) | _O(n)_ on average | _O(1)_ | Medium | š | Quick Select
2099 | [Find Subsequence of Length K With the Largest Sum](https://leetcode.com/problems/find-subsequence-of-length-k-with-the-largest-sum/) | [C++](./C++/find-subsequence-of-length-k-with-the-largest-sum.cpp) [Python](./Python/find-subsequence-of-length-k-with-the-largest-sum.py) | _O(n)_ on average | _O(n)_ | Easy | | Quick Select
2100 | [Find Good Days to Rob the Bank](https://leetcode.com/problems/find-good-days-to-rob-the-bank/) | [C++](./C++/find-good-days-to-rob-the-bank.cpp) [Python](./Python/find-good-days-to-rob-the-bank.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum
2106 | [Maximum Fruits Harvested After at Most K Steps](https://leetcode.com/problems/maximum-fruits-harvested-after-at-most-k-steps/) | [C++](./C++/maximum-fruits-harvested-after-at-most-k-steps.cpp) [Python](./Python/maximum-fruits-harvested-after-at-most-k-steps.py) | _O(n)_ | _O(n)_ | Hard | | Prefix Sum
2113 | [Elements in Array After Removing and Replacing Elements](https://leetcode.com/problems/elements-in-array-after-removing-and-replacing-elements/) | [C++](./C++/elements-in-array-after-removing-and-replacing-elements.cpp) [Python](./Python/elements-in-array-after-removing-and-replacing-elements.py) | _O(n)_ | _O(1)_ | Medium | š |
2121 | [Intervals Between Identical Elements](https://leetcode.com/problems/intervals-between-identical-elements/) | [C++](./C++/intervals-between-identical-elements.cpp) [Python](./Python/intervals-between-identical-elements.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum
2122 | [Recover the Original Array](https://leetcode.com/problems/recover-the-original-array/) | [C++](./C++/recover-the-original-array.cpp) [Python](./Python/recover-the-original-array.py) | _O(n^2)_ | _O(n)_ | Hard | |
2128 | [Remove All Ones With Row and Column Flips](https://leetcode.com/problems/remove-all-ones-with-row-and-column-flips/) | [C++](./C++/remove-all-ones-with-row-and-column-flips.cpp) [Python](./Python/remove-all-ones-with-row-and-column-flips.py) | _O(m * n)_ | _O(1)_ | Medium | š |
2132 | [Stamping the Grid](https://leetcode.com/problems/stamping-the-grid/) | [C++](./C++/stamping-the-grid.cpp) [Python](./Python/stamping-the-grid.py) | _O(m * n)_ | _O(m * n)_ | Hard | | Prefix Sum
2155 | [All Divisions With the Highest Score of a Binary Array](https://leetcode.com/problems/all-divisions-with-the-highest-score-of-a-binary-array/) | [C++](./C++/all-divisions-with-the-highest-score-of-a-binary-array.cpp) [Python](./Python/all-divisions-with-the-highest-score-of-a-binary-array.py) | _O(n)_ | _O(1)_ | Medium | | Prefix Sum
2194 | [Cells in a Range on an Excel Sheet](https://leetcode.com/problems/cells-in-a-range-on-an-excel-sheet/) | [C++](./C++/cells-in-a-range-on-an-excel-sheet.cpp) [Python](./Python/cells-in-a-range-on-an-excel-sheet.py) | _O(26^2)_ | _O(1)_ | Easy | |
2210 | [Count Hills and Valleys in an Array](https://leetcode.com/problems/count-hills-and-valleys-in-an-array/) | [C++](./C++/count-hills-and-valleys-in-an-array.cpp) [Python](./Python/count-hills-and-valleys-in-an-array.py) | _O(n)_ | _O(1)_ | Easy | | Simulation
2219 | [Maximum Sum Score of Array](https://leetcode.com/problems/maximum-sum-score-of-array/) | [C++](./C++/maximum-sum-score-of-array.cpp) [Python](./Python/maximum-sum-score-of-array.py) | _O(n)_ | _O(1)_ | Medium | š | Prefix Sum
2237 | [Count Positions on Street With Required Brightness](https://leetcode.com/problems/count-positions-on-street-with-required-brightness/) | [C++](./C++/count-positions-on-street-with-required-brightness.cpp) [Python](./Python/count-positions-on-street-with-required-brightness.py) | _O(n + l)_ | _O(min(n, l))_ | Medium | š | Line Sweep
2239 | [Find Closest Number to Zero](https://leetcode.com/problems/find-closest-number-to-zero/) | [C++](./C++/find-closest-number-to-zero.cpp) [Python](./Python/find-closest-number-to-zero.py) | _O(n)_ | _O(1)_ | Easy | | Array
2245 | [Maximum Trailing Zeros in a Cornered Path](https://leetcode.com/problems/maximum-trailing-zeros-in-a-cornered-path/) | [C++](./C++/maximum-trailing-zeros-in-a-cornered-path.cpp) [Python](./Python/maximum-trailing-zeros-in-a-cornered-path.py) | _O(m * n)_ | _O(m * n)_ | Medium | | Prefix Sum
2256 | [Minimum Average Difference](https://leetcode.com/problems/minimum-average-difference/) | [C++](./C++/minimum-average-difference.cpp) [Python](./Python/minimum-average-difference.py) | _O(n)_ | _O(1)_ | Medium | | Prefix Sum
2270 | [Number of Ways to Split Array](https://leetcode.com/problems/number-of-ways-to-split-array/) | [C++](./C++/number-of-ways-to-split-array.cpp) [Python](./Python/number-of-ways-to-split-array.py) | _O(n)_ | _O(1)_ | Medium | | Prefix Sum
2271 | [Maximum White Tiles Covered by a Carpet](https://leetcode.com/problems/maximum-white-tiles-covered-by-a-carpet/) | [C++](./C++/maximum-white-tiles-covered-by-a-carpet.cpp) [Python](./Python/maximum-white-tiles-covered-by-a-carpet.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sliding Window, Prefix Sum, Binary Search
2274 | [Maximum Consecutive Floors Without Special Floors](https://leetcode.com/problems/maximum-consecutive-floors-without-special-floors/) | [C++](./C++/maximum-consecutive-floors-without-special-floors.cpp) [Python](./Python/maximum-consecutive-floors-without-special-floors.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort
2293 | [Min Max Game](https://leetcode.com/problems/min-max-game/) | [C++](./C++/min-max-game.cpp) [Python](./Python/min-max-game.py) | _O(n)_ | _O(1)_ | Medium | | Simulation
2319 | [Check if Matrix Is X-Matrix](https://leetcode.com/problems/check-if-matrix-is-x-matrix/) | [C++](./C++/check-if-matrix-is-x-matrix.cpp) [Python](./Python/check-if-matrix-is-x-matrix.py) | _O(n^2)_ | _O(1)_ | Easy | | Array
2326 | [Spiral Matrix IV](https://leetcode.com/problems/spiral-matrix-iv/) | [C++](./C++/spiral-matrix-iv.cpp) [Python](./Python/spiral-matrix-iv.py) | _O(m * n)_ | _O(1)_ | Medium | | Linked List, Array
2373 | [Largest Local Values in a Matrix](https://leetcode.com/problems/largest-local-values-in-a-matrix/) | [C++](./C++/largest-local-values-in-a-matrix.cpp) [Python](./Python/largest-local-values-in-a-matrix.py) | _O(n^2)_ | _O(1)_ | Easy | | Array
2382 | [Maximum Segment Sum After Removals](https://leetcode.com/problems/maximum-segment-sum-after-removals/) | [C++](./C++/maximum-segment-sum-after-removals.cpp) [Python](./Python/maximum-segment-sum-after-removals.py) | _O(n)_ | _O(n)_ | Hard | | Prefix Sum, Sorted List, BST, Union Find
2391 | [Minimum Amount of Time to Collect Garbage](https://leetcode.com/problems/minimum-amount-of-time-to-collect-garbage/) | [C++](./C++/minimum-amount-of-time-to-collect-garbage.cpp) [Python](./Python/minimum-amount-of-time-to-collect-garbage.py) | _O(n * l)_ | _O(1)_ | Medium | | Prefix Sum, Simulation
2406 | [Divide Intervals Into Minimum Number of Groups](https://leetcode.com/problems/divide-intervals-into-minimum-number-of-groups/) | [C++](./C++/divide-intervals-into-minimum-number-of-groups.cpp) [Python](./Python/divide-intervals-into-minimum-number-of-groups.py) | _O(nlogn)_ | _O(n)_ | Medium | | Sort, Line Sweep
2407 | [Longest Increasing Subsequence II](https://leetcode.com/problems/longest-increasing-subsequence-ii/) | [C++](./C++/longest-increasing-subsequence-ii.cpp) [Python](./Python/longest-increasing-subsequence-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | variant of [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | Segment Tree, Coordinate Compression
2428 | [Maximum Sum of an Hourglass](https://leetcode.com/problems/maximum-sum-of-an-hourglass/) | [C++](./C++/maximum-sum-of-an-hourglass.cpp) [Python](./Python/maximum-sum-of-an-hourglass.py) | _O(m * n)_ | _O(1)_ | Medium | | Brute Force
2432 | [The Employee That Worked on the Longest Task](https://leetcode.com/problems/the-employee-that-worked-on-the-longest-task/) | [C++](./C++/the-employee-that-worked-on-the-longest-task.cpp) [Python](./Python/the-employee-that-worked-on-the-longest-task.py) | _O(l)_ | _O(1)_ | Easy | | Array
2433 | [Find The Original Array of Prefix Xor](https://leetcode.com/problems/find-the-original-array-of-prefix-xor/) | [C++](./C++/find-the-original-array-of-prefix-xor.cpp) [Python](./Python/find-the-original-array-of-prefix-xor.py) | _O(n)_ | _O(1)_ | Medium | | Array
2438 | [Range Product Queries of Powers](https://leetcode.com/problems/range-product-queries-of-powers/) | [C++](./C++/range-product-queries-of-powers.cpp) [Python](./Python/range-product-queries-of-powers.py) | _O(logn + qlogr)_ | _O(logn)_ | Medium | | Prefix Sum
2446 | [Determine if Two Events Have Conflict](https://leetcode.com/problems/determine-if-two-events-have-conflict/) | [C++](./C++/determine-if-two-events-have-conflict.cpp) [Python](./Python/determine-if-two-events-have-conflict.py) | _O(1)_ | _O(1)_ | Easy | | Array
2460 | [Apply Operations to an Array](https://leetcode.com/problems/apply-operations-to-an-array/) | [C++](./C++/apply-operations-to-an-array.cpp) [Python](./Python/apply-operations-to-an-array.py) | _O(n)_ | _O(1)_ | Easy | | Inplace, Array
2482 | [Difference Between Ones and Zeros in Row and Column](https://leetcode.com/problems/difference-between-ones-and-zeros-in-row-and-column/) | [C++](./C++/difference-between-ones-and-zeros-in-row-and-column.cpp) [Python](./Python/difference-between-ones-and-zeros-in-row-and-column.py) | _O(m * n)_ | _O(m + n)_ | Medium | | Array
2500 | [Delete Greatest Value in Each Row](https://leetcode.com/problems/delete-greatest-value-in-each-row/) | [C++](./C++/delete-greatest-value-in-each-row.cpp) [Python](./Python/delete-greatest-value-in-each-row.py) | _O(m * nlogn)_ | _O(1)_ | Easy | | Array
2515 | [Shortest Distance to Target String in a Circular Array](https://leetcode.com/problems/shortest-distance-to-target-string-in-a-circular-array/) | [C++](./C++/shortest-distance-to-target-string-in-a-circular-array.cpp) [Python](./Python/shortest-distance-to-target-string-in-a-circular-array.py) | _O(n)_ | _O(1)_ | Easy | | Array
2535 | [Difference Between Element Sum and Digit Sum of an Array](https://leetcode.com/problems/difference-between-element-sum-and-digit-sum-of-an-array/) | [C++](./C++/difference-between-element-sum-and-digit-sum-of-an-array.cpp) [Python](./Python/difference-between-element-sum-and-digit-sum-of-an-array.py) | _O(nlogr)_ | _O(1)_ | Easy | | Array
2536 | [Increment Submatrices by One](https://leetcode.com/problems/increment-submatrices-by-one/) | [C++](./C++/increment-submatrices-by-one.cpp) [Python](./Python/increment-submatrices-by-one.py) | _O(q + n^2)_ | _O(1)_ | Medium | | Line Sweep, Difference Matrix, Difference Array
2553 | [Separate the Digits in an Array](https://leetcode.com/problems/separate-the-digits-in-an-array/) | [C++](./C++/separate-the-digits-in-an-array.cpp) [Python](./Python/separate-the-digits-in-an-array.py) | _O(n * logr)_ | _O(1)_ | Easy | | Array
2559 | [Count Vowel Strings in Ranges](https://leetcode.com/problems/count-vowel-strings-in-ranges/) | [C++](./C++/count-vowel-strings-in-ranges.cpp) [Python](./Python/count-vowel-strings-in-ranges.py) | _O(n + q)_ | _O(n)_ | Medium | | Prefix Sum
2569 | [Handling Sum Queries After Update](https://leetcode.com/problems/handling-sum-queries-after-update/)| [C++](./C++/handling-sum-queries-after-update.cpp) [Python](./Python/handling-sum-queries-after-update.py)| _O(nlogn + m + qlogn)_ | _O(n)_ | Hard | | Segment Tree |
2574 | [Left and Right Sum Differences](https://leetcode.com/problems/left-and-right-sum-differences/)| [C++](./C++/left-and-right-sum-differences.cpp) [Python](./Python/left-and-right-sum-differences.py)| _O(n)_ | _O(1)_ | Easy | | Prefix Sum |
2580 | [Count Ways to Group Overlapping Ranges](https://leetcode.com/problems/count-ways-to-group-overlapping-ranges/)| [C++](./C++/count-ways-to-group-overlapping-ranges.cpp) [Python](./Python/count-ways-to-group-overlapping-ranges.py)| _O(nlogn)_ | _O(1)_ | Medium | | Sort, Array |
2639 | [Find the Width of Columns of a Grid](https://leetcode.com/problems/find-the-width-of-columns-of-a-grid/)| [C++](./C++/find-the-width-of-columns-of-a-grid.cpp) [Python](./Python/find-the-width-of-columns-of-a-grid.py)| _O(m * n)_ | _O(1)_ | Easy | | Array |
2640 | [Find the Score of All Prefixes of an Array](https://leetcode.com/problems/find-the-score-of-all-prefixes-of-an-array/)| [C++](./C++/find-the-score-of-all-prefixes-of-an-array.cpp) [Python](./Python/find-the-score-of-all-prefixes-of-an-array.py)| _O(n)_ | _O(1)_ | Medium | | Prefix Sum |
2643 | [Row With Maximum Ones](https://leetcode.com/problems/row-with-maximum-ones/)| [C++](./C++/row-with-maximum-ones.cpp) [Python](./Python/row-with-maximum-ones.py)| _O(m * n)_ | _O(1)_ | Easy | | Array |
2644 | [Find the Maximum Divisibility Score](https://leetcode.com/problems/find-the-maximum-divisibility-score/)| [C++](./C++/find-the-maximum-divisibility-score.cpp) [Python](./Python/find-the-maximum-divisibility-score.py)| _O(n * d)_ | _O(1)_ | Easy | | Brute force |
2655 | [Find Maximal Uncovered Ranges](https://leetcode.com/problems/find-maximal-uncovered-ranges/) | [C++](./C++/find-maximal-uncovered-ranges.cpp) [Python](./Python/find-maximal-uncovered-ranges.py) | _O(nlogn)_ | _O(n)_ | Medium | š, variant of [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | Sort, Line Sweep
2660 | [Determine the Winner of a Bowling Game](https://leetcode.com/problems/determine-the-winner-of-a-bowling-game/) | [C++](./C++/determine-the-winner-of-a-bowling-game.cpp) [Python](./Python/determine-the-winner-of-a-bowling-game.py) | _O(n)_ | _O(1)_ | Medium | | Array
2672 | [Number of Adjacent Elements With the Same Color](https://leetcode.com/problems/number-of-adjacent-elements-with-the-same-color/) | [C++](./C++/number-of-adjacent-elements-with-the-same-color.cpp) [Python](./Python/number-of-adjacent-elements-with-the-same-color.py) | _O(n + q)_ | _O(n)_ | Medium | | Array
2683 | [Neighboring Bitwise XOR](https://leetcode.com/problems/neighboring-bitwise-xor/) | [C++](./C++/neighboring-bitwise-xor.cpp) [Python](./Python/neighboring-bitwise-xor.py) | _O(n)_ | _O(1)_ | Medium | | Array
2711 | [Difference of Number of Distinct Values on Diagonals](https://leetcode.com/problems/difference-of-number-of-distinct-values-on-diagonals/) | [C++](./C++/difference-of-number-of-distinct-values-on-diagonals.cpp) [Python](./Python/difference-of-number-of-distinct-values-on-diagonals.py) | _O(m * n)_ | _O(min(m, n))_ | Medium | | Prefix Sum
2717 | [Semi-Ordered Permutation](https://leetcode.com/problems/semi-ordered-permutation/) | [C++](./C++/semi-ordered-permutation.cpp) [Python](./Python/semi-ordered-permutation.py) | _O(n)_ | _O(1)_ | Easy | | Array
2733 | [Neither Minimum nor Maximum](https://leetcode.com/problems/neither-minimum-nor-maximum/) | [C++](./C++/neither-minimum-nor-maximum.cpp) [Python](./Python/neither-minimum-nor-maximum.py) | _O(n)_ | _O(1)_ | Easy | | Array
2760 | [Longest Even Odd Subarray With Threshold](https://leetcode.com/problems/longest-even-odd-subarray-with-threshold/) | [C++](./C++/longest-even-odd-subarray-with-threshold.cpp) [Python](./Python/longest-even-odd-subarray-with-threshold.py) | _O(n)_ | _O(1)_ | Easy | | Array
2765 | [Longest Alternating Subarray](https://leetcode.com/problems/longest-alternating-subarray/) | [C++](./C++/longest-alternating-subarray.cpp) [Python](./Python/longest-alternating-subarray.py) | _O(n)_ | _O(1)_ | Easy | | Array
2782 | [Number of Unique Categories](https://leetcode.com/problems/number-of-unique-categories/) | [C++](./C++/number-of-unique-categories.cpp) [Python](./Python/number-of-unique-categories.py) | _O(n^2)_ | _O(1)_ | Medium | š | Brute Force
2798 | [Number of Employees Who Met the Target](https://leetcode.com/problems/number-of-employees-who-met-the-target/) | [C++](./C++/number-of-employees-who-met-the-target.cpp) [Python](./Python/number-of-employees-who-met-the-target.py) | _O(n)_ | _O(1)_ | Easy | | Array
2848 | [Points That Intersect With Cars](https://leetcode.com/problems/points-that-intersect-with-cars/) | [C++](./C++/points-that-intersect-with-cars.cpp) [Python](./Python/points-that-intersect-with-cars.py) | _O(nlogn)_ | _O(1)_ | Easy | | Sort, Line Sweep
2855 | [Minimum Right Shifts to Sort the Array](https://leetcode.com/problems/minimum-right-shifts-to-sort-the-array/) | [C++](./C++/minimum-right-shifts-to-sort-the-array.cpp) [Python](./Python/minimum-right-shifts-to-sort-the-array.py) | _O(n)_ | _O(1)_ | Easy | | Array
2873 | [Maximum Value of an Ordered Triplet I](https://leetcode.com/problems/maximum-value-of-an-ordered-triplet-i/) | [C++](./C++/maximum-value-of-an-ordered-triplet-i.cpp) [Python](./Python/maximum-value-of-an-ordered-triplet-i.py) | _O(n)_ | _O(1)_ | Easy | | Array
2874 | [Maximum Value of an Ordered Triplet II](https://leetcode.com/problems/maximum-value-of-an-ordered-triplet-ii/) | [C++](./C++/maximum-value-of-an-ordered-triplet-ii.cpp) [Python](./Python/maximum-value-of-an-ordered-triplet-ii.py) | _O(n)_ | _O(1)_ | Easy | | Array
2903 | [Find Indices With Index and Value Difference I](https://leetcode.com/problems/find-indices-with-index-and-value-difference-i/) | [C++](./C++/find-indices-with-index-and-value-difference-i.cpp) [Python](./Python/find-indices-with-index-and-value-difference-i.py) | _O(n)_ | _O(1)_ | Easy | | Prefix Sum
2905 | [Find Indices With Index and Value Difference II](https://leetcode.com/problems/find-indices-with-index-and-value-difference-ii/) | [C++](./C++/find-indices-with-index-and-value-difference-ii.cpp) [Python](./Python/find-indices-with-index-and-value-difference-ii.py) | _O(n)_ | _O(1)_ | Medium | | Prefix Sum
2906 | [Construct Product Matrix](https://leetcode.com/problems/construct-product-matrix/) | [C++](./C++/construct-product-matrix.cpp) [Python](./Python/construct-product-matrix.py) | _O(m * n)_ | _O(m * n)_ | Medium | | Prefix Sum
2908 | [Minimum Sum of Mountain Triplets I](https://leetcode.com/problems/minimum-sum-of-mountain-triplets-i/) | [C++](./C++/minimum-sum-of-mountain-triplets-i.cpp) [Python](./Python/minimum-sum-of-mountain-triplets-i.py) | _O(n)_ | _O(n)_ | Easy | | Prefix Sum
2909 | [Minimum Sum of Mountain Triplets II](https://leetcode.com/problems/minimum-sum-of-mountain-triplets-ii/) | [C++](./C++/minimum-sum-of-mountain-triplets-ii.cpp) [Python](./Python/minimum-sum-of-mountain-triplets-ii.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum
2923 | [Find Champion I](https://leetcode.com/problems/find-champion-i/) | [C++](./C++/find-champion-i.cpp) [Python](./Python/find-champion-i.py) | _O(n^2)_ | _O(1)_ | Easy | | Array
2946 | [Matrix Similarity After Cyclic Shifts](https://leetcode.com/problems/matrix-similarity-after-cyclic-shifts/) | [C++](./C++/matrix-similarity-after-cyclic-shifts.cpp) [Python](./Python/matrix-similarity-after-cyclic-shifts.py) | _O(m * n)_ | _O(1)_ | Easy | | Array
2951 | [Find the Peaks](https://leetcode.com/problems/find-the-peaks/) | [C++](./C++/find-the-peaks.cpp) [Python](./Python/find-the-peaks.py) | _O(n)_ | _O(1)_ | Easy | | Array
2965 | [Find Missing and Repeated Values](https://leetcode.com/problems/find-missing-and-repeated-values/) | [C++](./C++/find-missing-and-repeated-values.cpp) [Python](./Python/find-missing-and-repeated-values.py) | _O(n^2)_ | _O(1)_ | Easy | | Array, Freq Table, Bit Manipulation
2966 | [Divide Array Into Arrays With Max Difference](https://leetcode.com/problems/divide-array-into-arrays-with-max-difference/) | [C++](./C++/divide-array-into-arrays-with-max-difference.cpp) [Python](./Python/divide-array-into-arrays-with-max-difference.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Array
3000 | [Maximum Area of Longest Diagonal Rectangle](https://leetcode.com/problems/maximum-area-of-longest-diagonal-rectangle/) | [C++](./C++/maximum-area-of-longest-diagonal-rectangle.cpp) [Python](./Python/maximum-area-of-longest-diagonal-rectangle.py) | _O(n)_ | _O(1)_ | Easy | | Array
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
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## String
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2042 | [Check if Numbers Are Ascending in a Sentence](https://leetcode.com/problems/check-if-numbers-are-ascending-in-a-sentence/) | [C++](./C++/check-if-numbers-are-ascending-in-a-sentence.cpp) [Python](./Python/check-if-numbers-are-ascending-in-a-sentence.py) | _O(n)_ | _O(1)_ | Easy |||
2047 | [Number of Valid Words in a Sentence](https://leetcode.com/problems/number-of-valid-words-in-a-sentence/) | [C++](./C++/number-of-valid-words-in-a-sentence.cpp) [Python](./Python/number-of-valid-words-in-a-sentence.py) | _O(n)_ | _O(1)_ | Easy |||
2048 | [Next Greater Numerically Balanced Number](https://leetcode.com/problems/next-greater-numerically-balanced-number/) | [C++](./C++/next-greater-numerically-balanced-number.cpp) [Python](./Python/next-greater-numerically-balanced-number.py) | _O(1)_ | _O(1)_ | Medium || Permutations, Precompute, Binary Search |
2081 | [Sum of k-Mirror Numbers](https://leetcode.com/problems/sum-of-k-mirror-numbers/) | [C++](./C++/sum-of-k-mirror-numbers.cpp) [Python](./Python/sum-of-k-mirror-numbers.py) | _O(10^6)_ | _O(1)_ | Hard || String, Palindrome, Brute Force |
2103 | [Rings and Rods](https://leetcode.com/problems/rings-and-rods/) | [C++](./C++/rings-and-rods.cpp) [Python](./Python/rings-and-rods.py) | _O(n)_ | _O(1)_ | Easy || |
2108 | [Find First Palindromic String in the Array](https://leetcode.com/problems/find-first-palindromic-string-in-the-array/) | [C++](./C++/find-first-palindromic-string-in-the-array.cpp) [Python](./Python/find-first-palindromic-string-in-the-array.py) | _O(n)_ | _O(1)_ | Easy || |
2109 | [Adding Spaces to a String](https://leetcode.com/problems/adding-spaces-to-a-string/) | [C++](./C++/adding-spaces-to-a-string.cpp) [Python](./Python/adding-spaces-to-a-string.py) | _O(n)_ | _O(1)_ | Medium || Inplace |
2114 | [Maximum Number of Words Found in Sentences](https://leetcode.com/problems/maximum-number-of-words-found-in-sentences/) | [C++](./C++/maximum-number-of-words-found-in-sentences.cpp) [Python](./Python/maximum-number-of-words-found-in-sentences.py) | _O(n)_ | _O(1)_ | Easy |||
2116 | [Check if a Parentheses String Can Be Valid](https://leetcode.com/problems/check-if-a-parentheses-string-can-be-valid/) | [C++](./C++/check-if-a-parentheses-string-can-be-valid.cpp) [Python](./Python/check-if-a-parentheses-string-can-be-valid.py) | _O(n)_ | _O(1)_ | Medium |||
2124 | [Check if All A's Appears Before All B's](https://leetcode.com/problems/check-if-all-as-appears-before-all-bs/) | [C++](./C++/check-if-all-as-appears-before-all-bs.cpp) [Python](./Python/check-if-all-as-appears-before-all-bs.py) | _O(n)_ | _O(1)_ | Easy |||
2129 | [Capitalize the Title](https://leetcode.com/problems/capitalize-the-title/) | [C++](./C++/capitalize-the-title.cpp) [Python](./Python/capitalize-the-title.py) | _O(n)_ | _O(1)_ | Easy |||
2131 | [Longest Palindrome by Concatenating Two Letter Words](https://leetcode.com/problems/longest-palindrome-by-concatenating-two-letter-words/) | [C++](./C++/longest-palindrome-by-concatenating-two-letter-words.cpp) [Python](./Python/longest-palindrome-by-concatenating-two-letter-words.py) | _O(n)_ | _O(n)_ | Medium |||
2135 | [Count Words Obtained After Adding a Letter](https://leetcode.com/problems/count-words-obtained-after-adding-a-letter/) | [C++](./C++/count-words-obtained-after-adding-a-letter.cpp) [Python](./Python/count-words-obtained-after-adding-a-letter.py) | _O(n)_ | _O(n)_ | Medium || Bitmasks |
2138 | [Divide a String Into Groups of Size k](https://leetcode.com/problems/divide-a-string-into-groups-of-size-k/) | [C++](./C++/divide-a-string-into-groups-of-size-k.cpp) [Python](./Python/divide-a-string-into-groups-of-size-k.py) | _O(n)_ | _O(1)_ | Easy || |
2156 | [Find Substring With Given Hash Value](https://leetcode.com/problems/find-substring-with-given-hash-value/) | [C++](./C++/find-substring-with-given-hash-value.cpp) [Python](./Python/find-substring-with-given-hash-value.py) | _O(n)_ | _O(1)_ | Medium | | `Rabin-Karp Algorithm`, Rolling Hash
2157 | [Groups of Strings](https://leetcode.com/problems/groups-of-strings/) | [C++](./C++/groups-of-strings.cpp) [Python](./Python/groups-of-strings.py) | _O(26 * n)_ | _O(26 * n)_ | Hard | | Bitmasks, Union Find
2168 | [Unique Substrings With Equal Digit Frequency](https://leetcode.com/problems/unique-substrings-with-equal-digit-frequency/) | [C++](./C++/unique-substrings-with-equal-digit-frequency.cpp) [Python](./Python/unique-substrings-with-equal-digit-frequency.py) | _O(n^2)_ | _O(n^2)_ | Medium | š | `Rabin-Karp Algorithm`, Rolling Hash
2185 | [Counting Words With a Given Prefix](https://leetcode.com/problems/counting-words-with-a-given-prefix/) | [C++](./C++/counting-words-with-a-given-prefix.cpp) [Python](./Python/counting-words-with-a-given-prefix.py) | _O(n * p)_ | _O(1)_ | Easy | |
2186 | [Minimum Number of Steps to Make Two Strings Anagram II](https://leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram-ii/) | [C++](./C++/minimum-number-of-steps-to-make-two-strings-anagram-ii.cpp) [Python](./Python/minimum-number-of-steps-to-make-two-strings-anagram-ii.py) | _O(n)_ | _O(1)_ | Medium | variant of [Minimum Number of Steps to Make Two Strings Anagram](https://leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram/) |
2211 | [Count Collisions on a Road](https://leetcode.com/problems/count-collisions-on-a-road/) | [C++](./C++/count-collisions-on-a-road.cpp) [Python](./Python/count-collisions-on-a-road.py) | _O(n)_ | _O(1)_ | Medium | | Counting, Simulation
2213 | [Longest Substring of One Repeating Character](https://leetcode.com/problems/longest-substring-of-one-repeating-character/) | [C++](./C++/longest-substring-of-one-repeating-character.cpp) [Python](./Python/longest-substring-of-one-repeating-character.py) | _O(nlogn)_ | _O(n)_ | Hard | | Segment Tree
2223 | [Sum of Scores of Built Strings](https://leetcode.com/problems/sum-of-scores-of-built-strings/) | [C++](./C++/sum-of-scores-of-built-strings.cpp) [Python](./Python/sum-of-scores-of-built-strings.py) | _O(n)_ | _O(n)_ | Hard | | `Z-Function`
2232 | [Minimize Result by Adding Parentheses to Expression](https://leetcode.com/problems/minimize-result-by-adding-parentheses-to-expression/) | [C++](./C++/minimize-result-by-adding-parentheses-to-expression.cpp) [Python](./Python/minimize-result-by-adding-parentheses-to-expression.py) | _O(n^2)_ | _O(1)_ | Medium | | Brute Force
2243 | [Calculate Digit Sum of a String](https://leetcode.com/problems/calculate-digit-sum-of-a-string/) | [C++](./C++/calculate-digit-sum-of-a-string.cpp) [Python](./Python/calculate-digit-sum-of-a-string.py) | _O(n)_ | _O(n)_ | Easy | | Simulation
2255 | [Count Prefixes of a Given String](https://leetcode.com/problems/count-prefixes-of-a-given-string/) | [C++](./C++/count-prefixes-of-a-given-string.cpp) [Python](./Python/count-prefixes-of-a-given-string.py) | _O(n * l)_ | _O(1)_ | Easy | | String
2264 | [Largest 3-Same-Digit Number in String](https://leetcode.com/problems/largest-3-same-digit-number-in-string/) | [C++](./C++/largest-3-same-digit-number-in-string.cpp) [Python](./Python/largest-3-same-digit-number-in-string.py) | _O(n)_ | _O(1)_ | Easy | | String
2269 | [Find the K-Beauty of a Number](https://leetcode.com/problems/find-the-k-beauty-of-a-number/) | [C++](./C++/find-the-k-beauty-of-a-number.cpp) [Python](./Python/find-the-k-beauty-of-a-number.py) | _O(logn)_ | _O(logn)_ | Easy | | Sliding Window
2272 | [Substring With Largest Variance](https://leetcode.com/problems/substring-with-largest-variance/) | [C++](./C++/substring-with-largest-variance.cpp) [Python](./Python/substring-with-largest-variance.py) | _O(a^2 * n)_ | _O(a)_ | Hard | | `Kadane's Algorithm`
2273 | [Find Resultant Array After Removing Anagrams](https://leetcode.com/problems/find-resultant-array-after-removing-anagrams/) | [C++](./C++/find-resultant-array-after-removing-anagrams.cpp) [Python](./Python/find-resultant-array-after-removing-anagrams.py) | _O(n * l)_ | _O(1)_ | Easy | | Freq Table, Sort
2278 | [Percentage of Letter in String](https://leetcode.com/problems/percentage-of-letter-in-string/) | [C++](./C++/percentage-of-letter-in-string.cpp) [Python](./Python/percentage-of-letter-in-string.py) | _O(n)_ | _O(1)_ | Easy | | String
2288 | [Apply Discount to Prices](https://leetcode.com/problems/apply-discount-to-prices/) | [C++](./C++/apply-discount-to-prices.cpp) [Python](./Python/apply-discount-to-prices.py) | _O(n)_ | _O(1)_ | Medium | | String
2299 | [Strong Password Checker II](https://leetcode.com/problems/strong-password-checker-ii/) | [C++](./C++/strong-password-checker-ii.cpp) [Python](./Python/strong-password-checker-ii.py) | _O(n)_ | _O(1)_ | Easy | | String
2301 | [Match Substring After Replacement](https://leetcode.com/problems/match-substring-after-replacement/) | [C++](./C++/match-substring-after-replacement.cpp) [Python](./Python/match-substring-after-replacement.py) | _O(n * k)_ | _O(m)_ | Hard | | Brute Force
2315 | [Count Asterisks](https://leetcode.com/problems/count-asterisks/) | [C++](./C++/count-asterisks.cpp) [Python](./Python/count-asterisks.py) | _O(n)_ | _O(1)_ | Easy | | String
2381 | [Shifting Letters II](https://leetcode.com/problems/shifting-letters-ii/) | [C++](./C++/shifting-letters-ii.cpp) [Python](./Python/shifting-letters-ii.py) | _O(n)_ | _O(n)_ | Medium | | Line Sweep
2390 | [Removing Stars From a String](https://leetcode.com/problems/removing-stars-from-a-string/) | [C++](./C++/removing-stars-from-a-string.cpp) [Python](./Python/removing-stars-from-a-string.py) | _O(n)_ | _O(n)_ | Medium | | String, Stack
2414 | [Length of the Longest Alphabetical Continuous Substring](https://leetcode.com/problems/length-of-the-longest-alphabetical-continuous-substring/) | [C++](./C++/length-of-the-longest-alphabetical-continuous-substring.cpp) [Python](./Python/length-of-the-longest-alphabetical-continuous-substring.py) | _O(n)_ | _O(1)_ | Medium | | String
2416 | [Sum of Prefix Scores of Strings](https://leetcode.com/problems/sum-of-prefix-scores-of-strings/) | [C++](./C++/sum-of-prefix-scores-of-strings.cpp) [Python](./Python/sum-of-prefix-scores-of-strings.py) | _O(n * l)_ | _O(t)_ | Hard | | Trie
2490 | [Circular Sentence](https://leetcode.com/problems/circular-sentence/) | [C++](./C++/circular-sentence.cpp) [Python](./Python/circular-sentence.py) | _O(n)_ | _O(1)_ | Easy | | String
2496 | [Maximum Value of a String in an Array](https://leetcode.com/problems/maximum-value-of-a-string-in-an-array/) | [C++](./C++/maximum-value-of-a-string-in-an-array.cpp) [Python](./Python/maximum-value-of-a-string-in-an-array.py) | _O(n * l)_ | _O(1)_ | Easy | | String
2575 | [Find the Divisibility Array of a String](https://leetcode.com/problems/find-the-divisibility-array-of-a-string/)| [C++](./C++/find-the-divisibility-array-of-a-string.cpp) [Python](./Python/find-the-divisibility-array-of-a-string.py)| _O(n)_ | _O(1)_ | Medium | | Prefix Sum |
2586 | [Count the Number of Vowel Strings in Range](https://leetcode.com/problems/count-the-number-of-vowel-strings-in-range/)| [C++](./C++/count-the-number-of-vowel-strings-in-range.cpp) [Python](./Python/count-the-number-of-vowel-strings-in-range.py)| _O(n)_ | _O(1)_ | Medium | | String |
2678 | [Number of Senior Citizens](https://leetcode.com/problems/number-of-senior-citizens/)| [C++](./C++/number-of-senior-citizens.cpp) [Python](./Python/number-of-senior-citizens.py)| _O(n)_ | _O(1)_ | Easy | | String |
2710 | [Remove Trailing Zeros From a String](https://leetcode.com/problems/remove-trailing-zeros-from-a-string/)| [C++](./C++/remove-trailing-zeros-from-a-string.cpp) [Python](./Python/remove-trailing-zeros-from-a-string.py)| _O(n)_ | _O(1)_ | Easy | | String |
2729 | [Check if The Number is Fascinating](https://leetcode.com/problems/check-if-the-number-is-fascinating/)| [C++](./C++/check-if-the-number-is-fascinating.cpp) [Python](./Python/check-if-the-number-is-fascinating.py)| _O(logn)_ | _O(1)_ | Easy | | String, Bitmasks |
2788 | [Split Strings by Separator](https://leetcode.com/problems/split-strings-by-separator/)| [C++](./C++/split-strings-by-separator.cpp) [Python](./Python/split-strings-by-separator.py)| _O(n * l)_ | _O(l)_ | Easy | | String |
2800 | [Shortest String That Contains Three Strings](https://leetcode.com/problems/shortest-string-that-contains-three-strings/)| [C++](./C++/shortest-string-that-contains-three-strings.cpp) [Python](./Python/shortest-string-that-contains-three-strings.py)| _O(l)_ | _O(l)_ | Medium | | String, Brute Force, Longest Prefix Suffix, `KMP Algorithm` |
2810 | [Faulty Keyboard](https://leetcode.com/problems/faulty-keyboard/)| [C++](./C++/faulty-keyboard.cpp) [Python](./Python/faulty-keyboard.py)| _O(n)_ | _O(n)_ | Easy | | String, Deque |
2828 | [Check if a String Is an Acronym of Words](https://leetcode.com/problems/check-if-a-string-is-an-acronym-of-words/)| [C++](./C++/check-if-a-string-is-an-acronym-of-words.cpp) [Python](./Python/check-if-a-string-is-an-acronym-of-words.py)| _O(n)_ | _O(1)_ | Easy | | String |
2843 | [Count Symmetric Integers](https://leetcode.com/problems/count-symmetric-integers/)| [C++](./C++/count-symmetric-integers.cpp) [Python](./Python/count-symmetric-integers.py)| _O(rlogr)_ | _O(r)_ | Easy | | String, Brute Force, Memoization |
2851 | [String Transformation](https://leetcode.com/problems/string-transformation/) | [C++](./C++/string-transformation.cpp) [Python](./Python/string-transformation.py) | _O(n + logk)_ | _O(n)_ | Hard | | DP, Matrix Exponentiation, Math, `Z-Function`, `KMP Algorithm`
2937 | [Make Three Strings Equal](https://leetcode.com/problems/make-three-strings-equal/)| [C++](./C++/make-three-strings-equal.cpp) [Python](./Python/make-three-strings-equal.py)| _O(n)_ | _O(1)_ | Easy | | String |
2942 | [Find Words Containing Character](https://leetcode.com/problems/find-words-containing-character/)| [C++](./C++/find-words-containing-character.cpp) [Python](./Python/find-words-containing-character.py)| _O(n * l)_ | _O(1)_ | Easy | | String |
2967 | [Minimum Cost to Make Array Equalindromic](https://leetcode.com/problems/minimum-cost-to-make-array-equalindromic/)| [C++](./C++/minimum-cost-to-make-array-equalindromic.cpp) [Python](./Python/minimum-cost-to-make-array-equalindromic.py)| _O(n + logr)_ | _O(logr)_ | Medium | variant of [Find the Closest Palindrome](https://leetcode.com/problems/find-the-closest-palindrome/) | Sort, Quick Select, Math, String |
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
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Linked List
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2058 | [Find the Minimum and Maximum Number of Nodes Between Critical Points](https://leetcode.com/problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points/)| [C++](./C++/find-the-minimum-and-maximum-number-of-nodes-between-critical-points.cpp) [Python](./Python/find-the-minimum-and-maximum-number-of-nodes-between-critical-points.py) | _O(n)_ | _O(1)_ | Medium ||
2074 | [Reverse Nodes in Even Length Groups](https://leetcode.com/problems/reverse-nodes-in-even-length-groups/) | [C++](./C++/reverse-nodes-in-even-length-groups.cpp) [Python](./Python/reverse-nodes-in-even-length-groups.py) | _O(n)_ | _O(1)_ | Medium | |
2095 | [Delete the Middle Node of a Linked List](https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list/) | [C++](./C++/delete-the-middle-node-of-a-linked-list.cpp) [Python](./Python/delete-the-middle-node-of-a-linked-list.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers
2130 | [Maximum Twin Sum of a Linked List](https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list/) | [C++](./C++/maximum-twin-sum-of-a-linked-list.cpp) [Python](./Python/maximum-twin-sum-of-a-linked-list.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers
2181 | [Merge Nodes in Between Zeros](https://leetcode.com/problems/merge-nodes-in-between-zeros/) | [C++](./C++/merge-nodes-in-between-zeros.cpp) [Python](./Python/merge-nodes-in-between-zeros.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers
2487 | [Remove Nodes From Linked List](https://leetcode.com/problems/remove-nodes-from-linked-list/) | [C++](./C++/remove-nodes-from-linked-list.cpp) [Python](./Python/remove-nodes-from-linked-list.py) | _O(n)_ | _O(n)_ | Medium | | Mono Stack
2674 | [Split a Circular Linked List](https://leetcode.com/problems/split-a-circular-linked-list/) | [C++](./C++/split-a-circular-linked-list.cpp) [Python](./Python/split-a-circular-linked-list.py) | _O(n)_ | _O(1)_ | Medium |š| Two Pointers, Slow and Fast Pointers
2807 | [Insert Greatest Common Divisors in Linked List](https://leetcode.com/problems/insert-greatest-common-divisors-in-linked-list/) | [C++](./C++/insert-greatest-common-divisors-in-linked-list.cpp) [Python](./Python/insert-greatest-common-divisors-in-linked-list.py) | _O(n)_ | _O(1)_ | Medium | | Linked List
2816 | [Double a Number Represented as a Linked List](https://leetcode.com/problems/double-a-number-represented-as-a-linked-list/) | [C++](./C++/double-a-number-represented-as-a-linked-list.cpp) [Python](./Python/double-a-number-represented-as-a-linked-list.py) | _O(n)_ | _O(1)_ | Medium | | Linked List
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
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Stack
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2104 | [Sum of Subarray Ranges](https://leetcode.com/problems/sum-of-subarray-ranges/) | [C++](./C++/sum-of-subarray-ranges.cpp) [Python](./Python/sum-of-subarray-ranges.py) | _O(n)_ | _O(n)_ | Medium | | Mono Stack
2197 | [Replace Non-Coprime Numbers in Array](https://leetcode.com/problems/replace-non-coprime-numbers-in-array/) | [C++](./C++/replace-non-coprime-numbers-in-array.cpp) [Python](./Python/replace-non-coprime-numbers-in-array.py) | _O(nlogm)_ | _O(1)_ | Hard | | Stack, Math
2281 | [Sum of Total Strength of Wizards](https://leetcode.com/problems/sum-of-total-strength-of-wizards/) | [C++](./C++/sum-of-total-strength-of-wizards.cpp) [Python](./Python/sum-of-total-strength-of-wizards.py) | _O(n)_ | _O(n)_ | Hard | variant of [Largest Rectangle in Histogram](https://leetcode.com/problems/largest-rectangle-in-histogram/) | Mono Stack, Prefix Sum
2282 | [Number of People That Can Be Seen in a Grid](https://leetcode.com/problems/number-of-people-that-can-be-seen-in-a-grid/) | [C++](./C++/number-of-people-that-can-be-seen-in-a-grid.cpp) [Python](./Python/number-of-people-that-can-be-seen-in-a-grid.py) | _O(m * n)_ | _O(m + n)_ | Medium | š, variant of [Number of Visible People in a Queue](https://leetcode.com/problems/number-of-visible-people-in-a-queue/) | Mono Stack
2334 | [Subarray With Elements Greater Than Varying Threshold](https://leetcode.com/problems/subarray-with-elements-greater-than-varying-threshold/) | [C++](./C++/subarray-with-elements-greater-than-varying-threshold.cpp) [Python](./Python/subarray-with-elements-greater-than-varying-threshold.py) | _O(n)_ | _O(n)_ | Hard | variant of [Maximum Subarray Min-Product](https://leetcode.com/problems/maximum-subarray-min-product/) | Mono Stack
2355 | [Maximum Number of Books You Can Take](https://leetcode.com/problems/maximum-number-of-books-you-can-take/) | [C++](./C++/maximum-number-of-books-you-can-take.cpp) [Python](./Python/maximum-number-of-books-you-can-take.py) | _O(n)_ | _O(n)_ | Hard | š | Mono Stack, Math
2454 | [Next Greater Element IV](https://leetcode.com/problems/next-greater-element-iv/) | [C++](./C++/next-greater-element-iv.cpp) [Python](./Python/next-greater-element-iv.py) | _O(n)_ | _O(n)_ | Hard | | Mono Stack
2696 | [Minimum String Length After Removing Substrings](https://leetcode.com/problems/minimum-string-length-after-removing-substrings/) | [C++](./C++/minimum-string-length-after-removing-substrings.cpp) [Python](./Python/minimum-string-length-after-removing-substrings.py) | _O(n)_ | _O(n)_ | Easy | | Stack
2735 | [Collecting Chocolates](https://leetcode.com/problems/collecting-chocolates/) | [C++](./C++/collecting-chocolates.cpp) [Python](./Python/collecting-chocolates.py) | _O(n)_ | _O(n)_ | Medium | | Mono Stack, Difference Array, Prefix Sum, Binary Search, Mono Deque, Brute Force
2736 | [Maximum Sum Queries](https://leetcode.com/problems/maximum-sum-queries/) | [C++](./C++/maximum-sum-queries.cpp) [Python](./Python/maximum-sum-queries.py) | _O(nlogn + mlogm + mlogn)_ | _O(n + m)_ | Hard | | Sort, Mono Stack, Binary Search
2764 | [is Array a Preorder of Some āBinary Tree](https://leetcode.com/problems/is-array-a-preorder-of-some-binary-tree/) | [C++](./C++/is-array-a-preorder-of-some-binary-tree.cpp) [Python](./Python/is-array-a-preorder-of-some-binary-tree.py) | _O(n)_ | _O(n)_ | Medium | š | Stack
2832 | [Maximal Range That Each Element Is Maximum in It](https://leetcode.com/problems/maximal-range-that-each-element-is-maximum-in-it/) | [C++](./C++/maximal-range-that-each-element-is-maximum-in-it.cpp) [Python](./Python/maximal-range-that-each-element-is-maximum-in-it.py) | _O(n)_ | _O(n)_ | Medium | š | Mono Stack
2863 | [Maximum Length of Semi-Decreasing Subarrays](https://leetcode.com/problems/maximum-length-of-semi-decreasing-subarrays/) | [C++](./C++/maximum-length-of-semi-decreasing-subarrays.cpp) [Python](./Python/maximum-length-of-semi-decreasing-subarrays.py) | _O(n)_ | _O(n)_ | Medium | š | Sort, Mono Stack
2865 | [Beautiful Towers I](https://leetcode.com/problems/beautiful-towers-i/) | [C++](./C++/beautiful-towers-i.cpp) [Python](./Python/beautiful-towers-i.py) | _O(n)_ | _O(n)_ | Medium | | Mono Stack
2866 | [Beautiful Towers II](https://leetcode.com/problems/beautiful-towers-ii/) | [C++](./C++/beautiful-towers-ii.cpp) [Python](./Python/beautiful-towers-ii.py) | _O(n)_ | _O(n)_ | Medium | | Mono Stack
2899 | [Last Visited Integers](https://leetcode.com/problems/last-visited-integers/) | [C++](./C++/last-visited-integers.cpp) [Python](./Python/last-visited-integers.py) | _O(n)_ | _O(n)_ | Easy | | Stack
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
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Queue
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2398 | [Maximum Number of Robots Within Budget](https://leetcode.com/problems/maximum-number-of-robots-within-budget/) | [C++](./C++/maximum-number-of-robots-within-budget.cpp) [Python](./Python/maximum-number-of-robots-within-budget.py) | _O(n)_ | _O(n)_ | Hard | | Mono Deque, Sliding Window, Two Pointers |
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Binary Heap
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2054 | [Two Best Non-Overlapping Events](https://leetcode.com/problems/two-best-non-overlapping-events/) | [C++](./C++/two-best-non-overlapping-events.cpp) [Python](./Python/two-best-non-overlapping-events.py) | _O(nlogn)_ | _O(n)_ | Medium | | Line Sweep, Heap |
2163 | [Minimum Difference in Sums After Removal of Elements](https://leetcode.com/problems/minimum-difference-in-sums-after-removal-of-elements/) | [C++](./C++/minimum-difference-in-sums-after-removal-of-elements.cpp) [Python](./Python/minimum-difference-in-sums-after-removal-of-elements.py) | _O(nlogn)_ | _O(n)_ | Hard | | Heap, Prefix Sum |
2208 | [Minimum Operations to Halve Array Sum](https://leetcode.com/problems/minimum-operations-to-halve-array-sum/) | [C++](./C++/minimum-operations-to-halve-array-sum.cpp) [Python](./Python/minimum-operations-to-halve-array-sum.py) | _O(nlogn)_ | _O(n)_ | Medium | | Heap |
2386 | [Find the K-Sum of an Array](https://leetcode.com/problems/find-the-k-sum-of-an-array/) | [C++](./C++/find-the-k-sum-of-an-array.cpp) [Python](./Python/find-the-k-sum-of-an-array.py) | _O(nlogn + klogk)_ | _O(n + k)_ | Hard | | BFS, Heap |
2402 | [Meeting Rooms III](https://leetcode.com/problems/meeting-rooms-iii/) | [C++](./C++/meeting-rooms-iii.cpp) [Python](./Python/meeting-rooms-iii.py) | _O(mlogm + n + mlogn)_ | _O(n)_ | Hard | | Heap |
2462 | [Total Cost to Hire K Workers](https://leetcode.com/problems/total-cost-to-hire-k-workers/) | [C++](./C++/total-cost-to-hire-k-workers.cpp) [Python](./Python/total-cost-to-hire-k-workers.py) | _O(c + klogc)_ | _O(c)_ | Medium | | Heap, Two Pointers |
2519 | [Count the Number of K-Big Indices](https://leetcode.com/problems/count-the-number-of-k-big-indices/) | [C++](./C++/count-the-number-of-k-big-indices.cpp) [Python](./Python/count-the-number-of-k-big-indices.py) | _O(nlogk)_ | _O(n)_ | Hard | š | Heap, Ordered Set, Sorted List |
2530 | [Maximal Score After Applying K Operations](https://leetcode.com/problems/maximal-score-after-applying-k-operations/) | [C++](./C++/maximal-score-after-applying-k-operations.cpp) [Python](./Python/maximal-score-after-applying-k-operations.py) | _O(n + klogn)_ | _O(1)_ | Medium | | Heap, Simulation |
2558 | [Take Gifts From the Richest Pile](https://leetcode.com/problems/take-gifts-from-the-richest-pile/) | [C++](./C++/take-gifts-from-the-richest-pile.cpp) [Python](./Python/take-gifts-from-the-richest-pile.py) | _O(n + klogn)_ | _O(1)_ | Easy | | Heap, Simulation |
2818 | [Apply Operations to Maximize Score](https://leetcode.com/problems/apply-operations-to-maximize-score/) | [C++](./C++/apply-operations-to-maximize-score.cpp) [Python](./Python/apply-operations-to-maximize-score.py) | _O(sqrt(r) + n * (logr + sqrt(r)/log(sqrt(r))) + klogn)_ | _O(sqrt(r) + n)_ | Hard | | Number Theory, `Linear Sieve of Eratosthenes`, Mono Stack, Greedy, Sort, Heap |
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
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Tree
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2003 | [Smallest Missing Genetic Value in Each Subtree](https://leetcode.com/problems/smallest-missing-genetic-value-in-each-subtree/) |[C++](./C++/smallest-missing-genetic-value-in-each-subtree.cpp) [Python](./Python/smallest-missing-genetic-value-in-each-subtree.py) | _O(n)_ | _O(n)_ | Hard | | DFS, Stack
2096 | [Step-By-Step Directions From a Binary Tree Node to Another](https://leetcode.com/problems/step-by-step-directions-from-a-binary-tree-node-to-another/) |[C++](./C++/step-by-step-directions-from-a-binary-tree-node-to-another.cpp) [Python](./Python/step-by-step-directions-from-a-binary-tree-node-to-another.py) | _O(n)_ | _O(h)_ | Medium | | DFS, Stack
2179 | [Count Good Triplets in an Array](https://leetcode.com/problems/count-good-triplets-in-an-array/)| [C++](./C++/count-good-triplets-in-an-array.cpp) [Python](./Python/count-good-triplets-in-an-array.py)| _O(nlogn)_ | _O(n)_ | Hard | variant of [Create Sorted Array through Instructions](https://leetcode.com/problems/create-sorted-array-through-instructions/) | BIT, Fenwick Tree |
2196 | [Create Binary Tree From Descriptions](https://leetcode.com/problems/create-binary-tree-from-descriptions/)| [C++](./C++/create-binary-tree-from-descriptions.cpp) [Python](./Python/create-binary-tree-from-descriptions.py)| _O(n)_ | _O(n)_ | Medium | | |
2236 | [Root Equals Sum of Children](https://leetcode.com/problems/root-equals-sum-of-children/)| [C++](./C++/root-equals-sum-of-children.cpp) [Python](./Python/root-equals-sum-of-children.py)| _O(1)_ | _O(1)_ | Easy | | Tree |
2277 | [Closest Node to Path in Tree](https://leetcode.com/problems/closest-node-to-path-in-tree/)| [C++](./C++/closest-node-to-path-in-tree.cpp) [Python](./Python/closest-node-to-path-in-tree.py)| _O(n + q)_ | _O(n + q)_ | Hard | š | Tree, BFS, Binary Lifting, `Tarjan's Offline LCA Algorithm` |
2421 | [Number of Good Paths](https://leetcode.com/problems/number-of-good-paths/)| [C++](./C++/number-of-good-paths.cpp) [Python](./Python/number-of-good-paths.py)| _O(nlogn)_ | _O(n)_ | Hard | | Sort, Union Find |
2509 | [Cycle Length Queries in a Tree](https://leetcode.com/problems/cycle-length-queries-in-a-tree/)| [C++](./C++/cycle-length-queries-in-a-tree.cpp) [Python](./Python/cycle-length-queries-in-a-tree.py)| _O(q * n)_ | _O(1)_ | Hard | | Tree, LCA |
2846 | [Minimum Edge Weight Equilibrium Queries in a Tree](https://leetcode.com/problems/minimum-edge-weight-equilibrium-queries-in-a-tree/)| [C++](./C++/minimum-edge-weight-equilibrium-queries-in-a-tree.cpp) [Python](./Python/minimum-edge-weight-equilibrium-queries-in-a-tree.py)| _O(r * (n + q))_ | _O(r * n + q)_ | Hard | | Tree, Binary Lifting, `Tarjan's Offline LCA Algorithm` |
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 |
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Hash Table
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2006 | [Count Number of Pairs With Absolute Difference K](https://leetcode.com/problems/count-number-of-pairs-with-absolute-difference-k/) | [C++](./C++/count-number-of-pairs-with-absolute-difference-k.cpp) [Python](./Python/count-number-of-pairs-with-absolute-difference-k.py) | _O(n)_ | _O(n)_ | Easy | variant of [Two Sum](https://leetcode.com/problems/two-sum/) |
2023 | [Number of Pairs of Strings With Concatenation Equal to Target](https://leetcode.com/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target/) | [C++](./C++/number-of-pairs-of-strings-with-concatenation-equal-to-target.cpp) [Python](./Python/number-of-pairs-of-strings-with-concatenation-equal-to-target.py) | _O(n * l)_ | _O(n)_ | Medium | variant of [Two Sum](https://leetcode.com/problems/two-sum/) |
2025 | [Maximum Number of Ways to Partition an Array](https://leetcode.com/problems/maximum-number-of-ways-to-partition-an-array/) | [C++](./C++/maximum-number-of-ways-to-partition-an-array.cpp) [Python](./Python/maximum-number-of-ways-to-partition-an-array.py) | _O(n)_ | _O(n)_ | Hard || Prefix Sum
2032 | [Two Out of Three](https://leetcode.com/problems/two-out-of-three/) | [C++](./C++/two-out-of-three.cpp) [Python](./Python/two-out-of-three.py) | _O(n)_ | _O(min(n, r))_ | Easy || Counting
2053 | [Kth Distinct String in an Array](https://leetcode.com/problems/kth-distinct-string-in-an-array/) | [C++](./C++/kth-distinct-string-in-an-array.cpp) [Python](./Python/kth-distinct-string-in-an-array.py) | _O(n)_ | _O(n)_ | Easy ||
2068 | [Check Whether Two Strings are Almost Equivalent](https://leetcode.com/problems/check-whether-two-strings-are-almost-equivalent/) | [C++](./C++/check-whether-two-strings-are-almost-equivalent.cpp) [Python](./Python/check-whether-two-strings-are-almost-equivalent.py) | _O(n)_ | _O(1)_ | Easy ||
2085 | [Count Common Words With One Occurrence](https://leetcode.com/problems/count-common-words-with-one-occurrence/) | [C++](./C++/count-common-words-with-one-occurrence.cpp) [Python](./Python/count-common-words-with-one-occurrence.py) | _O(m + n)_ | _O(m + n)_ | Easy ||
2120 | [Execution of All Suffix Instructions Staying in a Grid](https://leetcode.com/problems/execution-of-all-suffix-instructions-staying-in-a-grid/) | [C++](./C++/execution-of-all-suffix-instructions-staying-in-a-grid.cpp) [Python](./Python/execution-of-all-suffix-instructions-staying-in-a-grid.py) | _O(m)_ | _O(m)_ | Medium ||
2150 | [Find All Lonely Numbers in the Array](https://leetcode.com/problems/find-all-lonely-numbers-in-the-array/) | [C++](./C++/find-all-lonely-numbers-in-the-array.cpp) [Python](./Python/find-all-lonely-numbers-in-the-array.py) | _O(n)_ | _O(n)_ | Medium ||
2154 | [Keep Multiplying Found Values by Two](https://leetcode.com/problems/keep-multiplying-found-values-by-two/) | [C++](./C++/keep-multiplying-found-values-by-two.cpp) [Python](./Python/keep-multiplying-found-values-by-two.py) | _O(n)_ | _O(n)_ | Easy ||
2170 | [Minimum Operations to Make the Array Alternating](https://leetcode.com/problems/minimum-operations-to-make-the-array-alternating/) | [C++](./C++/minimum-operations-to-make-the-array-alternating.cpp) [Python](./Python/minimum-operations-to-make-the-array-alternating.py) | _O(n)_ | _O(n)_ | Medium || Freq Table
2190 | [Most Frequent Number Following Key In an Array](https://leetcode.com/problems/most-frequent-number-following-key-in-an-array/) | [C++](./C++/most-frequent-number-following-key-in-an-array.cpp) [Python](./Python/most-frequent-number-following-key-in-an-array.py) | _O(n)_ | _O(n)_ | Easy || Freq Table
2201 | [Count Artifacts That Can Be Extracted](https://leetcode.com/problems/count-artifacts-that-can-be-extracted/) | [C++](./C++/count-artifacts-that-can-be-extracted.cpp) [Python](./Python/count-artifacts-that-can-be-extracted.py) | _O(a + d)_ | _O(d)_ | Medium || Hash Table
2206 | [Divide Array Into Equal Pairs](https://leetcode.com/problems/divide-array-into-equal-pairs/) | [C++](./C++/divide-array-into-equal-pairs.cpp) [Python](./Python/divide-array-into-equal-pairs.py) | _O(n)_ | _O(n)_ | Easy || Hash Table
2215 | [Find the Difference of Two Arrays](https://leetcode.com/problems/find-the-difference-of-two-arrays/) | [C++](./C++/find-the-difference-of-two-arrays.cpp) [Python](./Python/find-the-difference-of-two-arrays.py) | _O(n)_ | _O(n)_ | Easy || Hash Table
2225 | [Find Players With Zero or One Losses](https://leetcode.com/problems/find-players-with-zero-or-one-losses/) | [C++](./C++/find-players-with-zero-or-one-losses.cpp) [Python](./Python/find-players-with-zero-or-one-losses.py) | _O(nlogn)_ | _O(n)_ | Medium || Hash Table, Sort
2229 | [Check if an Array Is Consecutive](https://leetcode.com/problems/check-if-an-array-is-consecutive/) | [C++](./C++/check-if-an-array-is-consecutive.cpp) [Python](./Python/check-if-an-array-is-consecutive.py) | _O(n)_ | _O(n)_ | Easy |š| Hash Table, Sort
2260 | [Minimum Consecutive Cards to Pick Up](https://leetcode.com/problems/minimum-consecutive-cards-to-pick-up/) | [C++](./C++/minimum-consecutive-cards-to-pick-up.cpp) [Python](./Python/minimum-consecutive-cards-to-pick-up.py) | _O(n)_ | _O(n)_ | Medium || Hash Table
2261 | [K Divisible Elements Subarrays](https://leetcode.com/problems/k-divisible-elements-subarrays/) | [C++](./C++/k-divisible-elements-subarrays.cpp) [Python](./Python/k-divisible-elements-subarrays.py) | _O(n^2)_ | _O(t)_ | Medium | | Trie, `Rabin-Karp Algorithm`
2283 | [Check if Number Has Equal Digit Count and Digit Value](https://leetcode.com/problems/check-if-number-has-equal-digit-count-and-digit-value/) | [C++](./C++/check-if-number-has-equal-digit-count-and-digit-value.cpp) [Python](./Python/check-if-number-has-equal-digit-count-and-digit-value.py) | _O(n)_ | _O(1)_ | Easy || Freq Table
2284 | [Sender With Largest Word Count](https://leetcode.com/problems/sender-with-largest-word-count/) | [C++](./C++/sender-with-largest-word-count.cpp) [Python](./Python/sender-with-largest-word-count.py) | _O(n * l)_ | _O(n)_ | Medium || Freq Table
2287 | [Rearrange Characters to Make Target String](https://leetcode.com/problems/rearrange-characters-to-make-target-string/) | [C++](./C++/rearrange-characters-to-make-target-string.cpp) [Python](./Python/rearrange-characters-to-make-target-string.py) | _O(n + m)_ | _O(1)_ | Easy || Freq Table
2295 | [Replace Elements in an Array](https://leetcode.com/problems/replace-elements-in-an-array/) | [C++](./C++/replace-elements-in-an-array.cpp) [Python](./Python/replace-elements-in-an-array.py) | _O(n + m)_ | _O(n)_ | Medium || Hash Table
2306 | [Naming a Company](https://leetcode.com/problems/naming-a-company/) | [C++](./C++/naming-a-company.cpp) [Python](./Python/naming-a-company.py) | _O(26 * n * l)_ | _O(n * l)_ | Hard || Hash Table, Math
2309 | [Greatest English Letter in Upper and Lower Case](https://leetcode.com/problems/greatest-english-letter-in-upper-and-lower-case/) | [C++](./C++/greatest-english-letter-in-upper-and-lower-case.cpp) [Python](./Python/greatest-english-letter-in-upper-and-lower-case.py) | _O(n)_ | _O(1)_ | Easy || Freq Table, Hash Table
2325 | [Decode the Message](https://leetcode.com/problems/decode-the-message/) | [C++](./C++/decode-the-message.cpp) [Python](./Python/decode-the-message.py) | _O(n + m)_ | _O(1)_ | Easy || String, Hash Table
2341 | [Maximum Number of Pairs in Array](https://leetcode.com/problems/maximum-number-of-pairs-in-array/) | [C++](./C++/maximum-number-of-pairs-in-array.cpp) [Python](./Python/maximum-number-of-pairs-in-array.py) | _O(n)_ | _O(r)_ | Easy || Freq Table
2342 | [Max Sum of a Pair With Equal Sum of Digits](https://leetcode.com/problems/max-sum-of-a-pair-with-equal-sum-of-digits/) | [C++](./C++/max-sum-of-a-pair-with-equal-sum-of-digits.cpp) [Python](./Python/max-sum-of-a-pair-with-equal-sum-of-digits.py) | _O(nlogr)_ | _O(n)_ | Medium || Hash Table, Greedy
2347 | [Best Poker Hand](https://leetcode.com/problems/best-poker-hand/) | [C++](./C++/best-poker-hand.cpp) [Python](./Python/best-poker-hand.py) | _O(1)_ | _O(1)_ | Easy || Freq Table
2351 | [First Letter to Appear Twice](https://leetcode.com/problems/first-letter-to-appear-twice/) | [C++](./C++/first-letter-to-appear-twice.cpp) [Python](./Python/first-letter-to-appear-twice.py) | _O(n)_ | _O(1)_ | Easy || String, Hash Table
2352 | [Equal Row and Column Pairs](https://leetcode.com/problems/equal-row-and-column-pairs/) | [C++](./C++/equal-row-and-column-pairs.cpp) [Python](./Python/equal-row-and-column-pairs.py) | _O(n^2)_ | _O(n^2)_ | Medium || Hash Table
2354 | [Number of Excellent Pairs](https://leetcode.com/problems/number-of-excellent-pairs/) | [C++](./C++/number-of-excellent-pairs.cpp) [Python](./Python/number-of-excellent-pairs.py) | _O(n)_ | _O(n)_ | Hard || Bit Manipulation, Sort, Two Pointers, Freq Table, Combinatorics
2357 | [Make Array Zero by Subtracting Equal Amounts](https://leetcode.com/problems/make-array-zero-by-subtracting-equal-amounts/) | [C++](./C++/make-array-zero-by-subtracting-equal-amounts.cpp) [Python](./Python/make-array-zero-by-subtracting-equal-amounts.py) | _O(n)_ | _O(n)_ | Easy || Hash Table
2363 | [Merge Similar Items](https://leetcode.com/problems/merge-similar-items/) | [C++](./C++/merge-similar-items.cpp) [Python](./Python/merge-similar-items.py) | _O((m + n) * log(m + n))_ | _O(m + n)_ | Easy || Freq Table, Sort
2364 | [Count Number of Bad Pairs](https://leetcode.com/problems/count-number-of-bad-pairs/) | [C++](./C++/count-number-of-bad-pairs.cpp) [Python](./Python/count-number-of-bad-pairs.py) | _O(n)_ | _O(n)_ | Medium | variant of [Count Nice Pairs in an Array](https://leetcode.com/problems/count-nice-pairs-in-an-array/) | Hash Table
2365 | [Task Scheduler II](https://leetcode.com/problems/task-scheduler-ii/) | [C++](./C++/task-scheduler-ii.cpp) [Python](./Python/task-scheduler-ii.py) | _O(n)_ | _O(n)_ | Medium || Hash Table
2367 | [Number of Arithmetic Triplets](https://leetcode.com/problems/number-of-arithmetic-triplets/) | [C++](./C++/number-of-arithmetic-triplets.cpp) [Python](./Python/number-of-arithmetic-triplets.py) | _O(n)_ | _O(n)_ | Easy || Hash Table
2374 | [Node With Highest Edge Score](https://leetcode.com/problems/node-with-highest-edge-score/) | [C++](./C++/node-with-highest-edge-score.cpp) [Python](./Python/node-with-highest-edge-score.py) | _O(n)_ | _O(n)_ | Medium || Hash Table
2395 | [Find Subarrays With Equal Sum](https://leetcode.com/problems/find-subarrays-with-equal-sum/) | [C++](./C++/find-subarrays-with-equal-sum.cpp) [Python](./Python/find-subarrays-with-equal-sum.py) | _O(n)_ | _O(n)_ | Easy || Hash Table
2399 | [Check Distances Between Same Letters](https://leetcode.com/problems/check-distances-between-same-letters/) | [C++](./C++/check-distances-between-same-letters.cpp) [Python](./Python/check-distances-between-same-letters.py) | _O(n)_ | _O(1)_ | Easy || Hash Table
2404 | [Most Frequent Even Element](https://leetcode.com/problems/most-frequent-even-element/) | [C++](./C++/most-frequent-even-element.cpp) [Python](./Python/most-frequent-even-element.py) | _O(n)_ | _O(n)_ | Easy || Freq Table
2423 | [Remove Letter To Equalize Frequency](https://leetcode.com/problems/remove-letter-to-equalize-frequency/) | [C++](./C++/remove-letter-to-equalize-frequency.cpp) [Python](./Python/remove-letter-to-equalize-frequency.py) | _O(n)_ | _O(1)_ | Easy || Brute Force, Freq Table
2441 | [Largest Positive Integer That Exists With Its Negative](https://leetcode.com/problems/largest-positive-integer-that-exists-with-its-negative/) | [C++](./C++/largest-positive-integer-that-exists-with-its-negative.cpp) [Python](./Python/largest-positive-integer-that-exists-with-its-negative.py) | _O(n)_ | _O(n)_ | Easy || Hash Table
2442 | [Count Number of Distinct Integers After Reverse Operations](https://leetcode.com/problems/count-number-of-distinct-integers-after-reverse-operations/) | [C++](./C++/count-number-of-distinct-integers-after-reverse-operations.cpp) [Python](./Python/count-number-of-distinct-integers-after-reverse-operations.py) | _O(nlogr)_ | _O(n)_ | Medium || Hash Table
2451 | [Odd String Difference](https://leetcode.com/problems/odd-string-difference/) | [C++](./C++/odd-string-difference.cpp) [Python](./Python/odd-string-difference.py) | _O(m * n)_ | _O(1)_ | Easy || Freq Table
2452 | [Words Within Two Edits of Dictionary](https://leetcode.com/problems/words-within-two-edits-of-dictionary/) | [C++](./C++/words-within-two-edits-of-dictionary.cpp) [Python](./Python/words-within-two-edits-of-dictionary.py) | _O(25 * l * (n + q))_ | _O(25 * l * n)_ | Medium | variant of [MHC2022 - Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2022/round-3/problems/C) | Brute Force, Hash
2453 | [Destroy Sequential Targets](https://leetcode.com/problems/destroy-sequential-targets/) | [C++](./C++/destroy-sequential-targets.cpp) [Python](./Python/destroy-sequential-targets.py) | _O(n)_ | _O(s)_ | Medium | | Freq Table
2456 | [Most Popular Video Creator](https://leetcode.com/problems/most-popular-video-creator/) | [C++](./C++/most-popular-video-creator.cpp) [Python](./Python/most-popular-video-creator.py) | _O(n)_ | _O(n)_ | Medium | | Hash Table
2484 | [Count Palindromic Subsequences](https://leetcode.com/problems/count-palindromic-subsequences/) | [C++](./C++/count-palindromic-subsequences.cpp) [Python](./Python/count-palindromic-subsequences.py) | _O(100 * n)_ | _O(100 * n)_ | Hard | | Freq Table, Prefix Sum, DP
2488 | [Count Subarrays With Median K](https://leetcode.com/problems/count-subarrays-with-median-k/) | [C++](./C++/count-subarrays-with-median-k.cpp) [Python](./Python/count-subarrays-with-median-k.py) | _O(n)_ | _O(n)_ | Hard | | Freq Table, Prefix Sum
2489 | [Number of Substrings With Fixed Ratio](https://leetcode.com/problems/number-of-substrings-with-fixed-ratio/) | [C++](./C++/number-of-substrings-with-fixed-ratio.cpp) [Python](./Python/number-of-substrings-with-fixed-ratio.py) | _O(n)_ | _O(n)_ | Medium | š | Freq Table, Prefix Sum
2491 | [Divide Players Into Teams of Equal Skill](https://leetcode.com/problems/divide-players-into-teams-of-equal-skill/) | [C++](./C++/divide-players-into-teams-of-equal-skill.cpp) [Python](./Python/divide-players-into-teams-of-equal-skill.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table
2501 | [Longest Square Streak in an Array](https://leetcode.com/problems/longest-square-streak-in-an-array/) | [C++](./C++/longest-square-streak-in-an-array.cpp) [Python](./Python/longest-square-streak-in-an-array.py) | _O(nlogn)_ | _O(n)_ | Medium | | Hash Table, DP
2506 | [Count Pairs Of Similar Strings](https://leetcode.com/problems/count-pairs-of-similar-strings/) | [C++](./C++/count-pairs-of-similar-strings.cpp) [Python](./Python/count-pairs-of-similar-strings.py) | _O(n * l)_ | _O(n)_ | Easy | | Freq Table, Bitmask
2531 | [Make Number of Distinct Characters Equal](https://leetcode.com/problems/make-number-of-distinct-characters-equal/) | [C++](./C++/make-number-of-distinct-characters-equal.cpp) [Python](./Python/make-number-of-distinct-characters-equal.py) | _O(m + n)_ | _O(1)_ | Medium | | Freq Table
2564 | [Substring XOR Queries](https://leetcode.com/problems/substring-xor-queries/) | [C++](./C++/substring-xor-queries.cpp) [Python](./Python/substring-xor-queries.py) | _O(n * logr + q)_ | _O(min(n * logr, r))_ | Medium | | Hash Table
2588 | [Count the Number of Beautiful Subarrays](https://leetcode.com/problems/count-the-number-of-beautiful-subarrays/) | [C++](./C++/count-the-number-of-beautiful-subarrays.cpp) [Python](./Python/count-the-number-of-beautiful-subarrays.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Combinatorics
2592 | [Maximize Greatness of an Array](https://leetcode.com/problems/maximize-greatness-of-an-array/) | [C++](./C++/maximize-greatness-of-an-array.cpp) [Python](./Python/maximize-greatness-of-an-array.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Contructive Algorithms, Sort, Greedy, Two Pointers
2598 | [Smallest Missing Non-negative Integer After Operations](https://leetcode.com/problems/smallest-missing-non-negative-integer-after-operations/) | [C++](./C++/smallest-missing-non-negative-integer-after-operations.cpp) [Python](./Python/smallest-missing-non-negative-integer-after-operations.py) | _O(n)_ | _O(k)_ | Medium | | Freq Table
2605 | [Form Smallest Number From Two Digit Arrays](https://leetcode.com/problems/form-smallest-number-from-two-digit-arrays/) | [C++](./C++/form-smallest-number-from-two-digit-arrays.cpp) [Python](./Python/form-smallest-number-from-two-digit-arrays.py) | _O(m + n)_ | _O(m + n)_ | Easy | | Hash Table
2615 | [Sum of Distances](https://leetcode.com/problems/sum-of-distances/) | [C++](./C++/sum-of-distances.cpp) [Python](./Python/sum-of-distances.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Prefix Sum
2657 | [Find the Prefix Common Array of Two Arrays](https://leetcode.com/problems/find-the-prefix-common-array-of-two-arrays/) | [C++](./C++/find-the-prefix-common-array-of-two-arrays.cpp) [Python](./Python/find-the-prefix-common-array-of-two-arrays.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table
2661 | [First Completely Painted Row or Column](https://leetcode.com/problems/first-completely-painted-row-or-column/) | [C++](./C++/first-completely-painted-row-or-column.cpp) [Python](./Python/first-completely-painted-row-or-column.py) | _O(m * n)_ | _O(m * n)_ | Medium | | Hash Table
2670 | [Find the Distinct Difference Array](https://leetcode.com/problems/find-the-distinct-difference-array/) | [C++](./C++/find-the-distinct-difference-array.cpp) [Python](./Python/find-the-distinct-difference-array.py) | _O(n)_ | _O(n)_ | Easy | | Hash Table, Prefix Sum
2716 | [Minimize String Length](https://leetcode.com/problems/minimize-string-length/) | [C++](./C++/minimize-string-length.cpp) [Python](./Python/minimize-string-length.py) | _O(n)_ | _O(1)_ | Easy | | Hash Table
2718 | [Sum of Matrix After Queries](https://leetcode.com/problems/sum-of-matrix-after-queries/) | [C++](./C++/sum-of-matrix-after-queries.cpp) [Python](./Python/sum-of-matrix-after-queries.py) | _O(n + q)_ | _O(n)_ | Medium | | Hash Table
2744 | [Find Maximum Number of String Pairs](https://leetcode.com/problems/find-maximum-number-of-string-pairs/) | [C++](./C++/find-maximum-number-of-string-pairs.cpp) [Python](./Python/find-maximum-number-of-string-pairs.py) | _O(n)_ | _O(1)_ | Easy | | Hash Table
2748 | [Number of Beautiful Pairs](https://leetcode.com/problems/number-of-beautiful-pairs/) | [C++](./C++/number-of-beautiful-pairs.cpp) [Python](./Python/number-of-beautiful-pairs.py) | _O(nlogr)_ | _O(1)_ | Easy | | Number Theory, Freq Table
2766 | [Relocate Marbles](https://leetcode.com/problems/relocate-marbles/) | [C++](./C++/relocate-marbles.cpp) [Python](./Python/relocate-marbles.py) | _O(nlogn)_ | _O(n)_ | Medium | | Hash Table, Sort
2768 | [Number of Black Blocks](https://leetcode.com/problems/number-of-black-blocks/) | [C++](./C++/number-of-black-blocks.cpp) [Python](./Python/number-of-black-blocks.py) | _O(c)_ | _O(c)_ | Medium | | Freq Table
2784 | [Check if Array is Good](https://leetcode.com/problems/check-if-array-is-good/) | [C++](./C++/check-if-array-is-good.cpp) [Python](./Python/check-if-array-is-good.py) | _O(n)_ | _O(n)_ | Easy | | Freq Table
2808 | [Minimum Seconds to Equalize a Circular Array](https://leetcode.com/problems/minimum-seconds-to-equalize-a-circular-array/) | [C++](./C++/minimum-seconds-to-equalize-a-circular-array.cpp) [Python](./Python/minimum-seconds-to-equalize-a-circular-array.py) | _O(n)_ | _O(n)_ | Medium | | Hash Table
2815 | [Max Pair Sum in an Array](https://leetcode.com/problems/max-pair-sum-in-an-array/) | [C++](./C++/max-pair-sum-in-an-array.cpp) [Python](./Python/max-pair-sum-in-an-array.py) | _O(nlogr)_ | _O(1)_ | Easy | | Hash Table
2839 | [Check if Strings Can be Made Equal With Operations I](https://leetcode.com/problems/check-if-strings-can-be-made-equal-with-operations-i/) | [C++](./C++/check-if-strings-can-be-made-equal-with-operations-i.cpp) [Python](./Python/check-if-strings-can-be-made-equal-with-operations-i.py) | _O(1)_ | _O(1)_ | Easy | | Brute Force, Freq Table
2840 | [Check if Strings Can be Made Equal With Operations II](https://leetcode.com/problems/check-if-strings-can-be-made-equal-with-operations-ii/) | [C++](./C++/check-if-strings-can-be-made-equal-with-operations-ii.cpp) [Python](./Python/check-if-strings-can-be-made-equal-with-operations-ii.py) | _O(1)_ | _O(1)_ | Medium | | Freq Table
2845 | [Count of Interesting Subarrays](https://leetcode.com/problems/count-of-interesting-subarrays/) | [C++](./C++/count-of-interesting-subarrays.cpp) [Python](./Python/count-of-interesting-subarrays.py) | _O(n)_ | _O(m)_ | Medium | | Freq Table, Prefix Sum
2857 | [Count Pairs of Points With Distance k](https://leetcode.com/problems/count-pairs-of-points-with-distance-k/) | [C++](./C++/count-pairs-of-points-with-distance-k.cpp) [Python](./Python/count-pairs-of-points-with-distance-k.py) | _O(n * k)_ | _O(n)_ | Medium | | Freq Table
2869 | [Minimum Operations to Collect Elements](https://leetcode.com/problems/minimum-operations-to-collect-elements/) | [C++](./C++/minimum-operations-to-collect-elements.cpp) [Python](./Python/minimum-operations-to-collect-elements.py) | _O(n)_ | _O(k)_ | Easy | | Hash Table
2943 | [Maximize Area of Square Hole in Grid](https://leetcode.com/problems/maximize-area-of-square-hole-in-grid/) | [C++](./C++/maximize-area-of-square-hole-in-grid.cpp) [Python](./Python/maximize-area-of-square-hole-in-grid.py) | _O(h + v)_ | _O(h + v)_ | Medium | | Array, Sort, Hash Table
2947 | [Count Beautiful Substrings I](https://leetcode.com/problems/count-beautiful-substrings-i/) | [C++](./C++/count-beautiful-substrings-i.cpp) [Python](./Python/count-beautiful-substrings-i.py) | _O(n + sqrt(k))_ | _O(n)_ | Medium | | Brute Force, Number Theory, Prefix Sum, Freq Table
2949 | [Count Beautiful Substrings II](https://leetcode.com/problems/count-beautiful-substrings-ii/) | [C++](./C++/count-beautiful-substrings-ii.cpp) [Python](./Python/count-beautiful-substrings-ii.py) | _O(n + sqrt(k))_ | _O(n)_ | Hard | | Brute Force, Number Theory, Prefix Sum, Freq Table
2950 | [Number of Divisible Substrings](https://leetcode.com/problems/number-of-divisible-substrings/) | [C++](./C++/number-of-divisible-substrings.cpp) [Python](./Python/number-of-divisible-substrings.py) | _O(d * n)_ | _O(n)_ | Medium | š | Prefix Sum, Freq Table
2955 | [Number of Same-End Substrings](https://leetcode.com/problems/number-of-same-end-substrings/) | [C++](./C++/number-of-same-end-substrings.cpp) [Python](./Python/number-of-same-end-substrings.py) | _O(26 * (n + q))_ | _O(26 * n)_ | Medium | š | Freq Table, Prefix Sum
2956 | [Find Common Elements Between Two Arrays](https://leetcode.com/problems/find-common-elements-between-two-arrays/) | [C++](./C++/find-common-elements-between-two-arrays.cpp) [Python](./Python/find-common-elements-between-two-arrays.py) | _O(n + m)_ | _O(n + m)_ | Easy || Hash Table
2964 | [Number of Divisible Triplet Sums](https://leetcode.com/problems/number-of-divisible-triplet-sums/) | [C++](./C++/number-of-divisible-triplet-sums.cpp) [Python](./Python/number-of-divisible-triplet-sums.py) | _O(n^2)_ | _O(n)_ | Medium | š | Freq Table
2975 | [Maximum Square Area by Removing Fences From a Field](https://leetcode.com/problems/maximum-square-area-by-removing-fences-from-a-field/) | [C++](./C++/maximum-square-area-by-removing-fences-from-a-field.cpp) [Python](./Python/maximum-square-area-by-removing-fences-from-a-field.py) | _O(h^2 + v^2)_ | _O(min(h, v)^2)_ | Medium || Hash Table
2981 | [Find Longest Special Substring That Occurs Thrice I](https://leetcode.com/problems/find-longest-special-substring-that-occurs-thrice-i/) | [C++](./C++/find-longest-special-substring-that-occurs-thrice-i.cpp) [Python](./Python/find-longest-special-substring-that-occurs-thrice-i.py) | _O(26 * 3 + n * 3)_ | _O(26 * 3)_ | Medium || String, Brute Force, Freq Table, Hash Table
2982 | [Find Longest Special Substring That Occurs Thrice II](https://leetcode.com/problems/find-longest-special-substring-that-occurs-thrice-ii/) | [C++](./C++/find-longest-special-substring-that-occurs-thrice-ii.cpp) [Python](./Python/find-longest-special-substring-that-occurs-thrice-ii.py) | _O(26 * 3 + n * 3)_ | _O(26 * 3)_ | Medium || String, Hash Table
2983 | [Palindrome Rearrangement Queries](https://leetcode.com/problems/palindrome-rearrangement-queries/) | [C++](./C++/palindrome-rearrangement-queries.cpp) [Python](./Python/palindrome-rearrangement-queries.py) | _O(26 + d * n + d * q)_ | _O(26 + d * n)_ | Hard || Prefix Sum, Freq Table
2996 | [Smallest Missing Integer Greater Than Sequential Prefix Sum](https://leetcode.com/problems/smallest-missing-integer-greater-than-sequential-prefix-sum/) | [C++](./C++/smallest-missing-integer-greater-than-sequential-prefix-sum.cpp) [Python](./Python/smallest-missing-integer-greater-than-sequential-prefix-sum.py) | _O(n)_ | _O(n)_ | Easy || Hash Table
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)_<br>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
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Math
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2001 | [Number of Pairs of Interchangeable Rectangles](https://leetcode.com/problems/number-of-pairs-of-interchangeable-rectangles/)|[C++](./C++/number-of-pairs-of-interchangeable-rectangles.cpp) [Python](./Python/number-of-pairs-of-interchangeable-rectangles.py)| _O(n)_ | _O(n)_ | Medium | | Math |
2005 | [Subtree Removal Game with Fibonacci Tree](https://leetcode.com/problems/subtree-removal-game-with-fibonacci-tree/)|[C++](./C++/subtree-removal-game-with-fibonacci-tree.cpp) [Python](./Python/subtree-removal-game-with-fibonacci-tree.py)| _O(1)_ | _O(1)_ | Hard |š| Math, `Sprague-Grundy Theorem`, `Colon Principle` |
2028 | [Find Missing Observations](https://leetcode.com/problems/find-missing-observations/)|[C++](./C++/find-missing-observations.cpp) [Python](./Python/find-missing-observations.py)| _O(n)_ | _O(1)_ | Medium | | |
2029 | [Stone Game IX](https://leetcode.com/problems/stone-game-ix/)|[C++](./C++/stone-game-ix.cpp) [Python](./Python/stone-game-ix.py)| _O(n)_ | _O(1)_ | Medium | |
2063 | [Vowels of All Substrings](https://leetcode.com/problems/vowels-of-all-substrings/)|[C++](./C++/vowels-of-all-substrings.cpp) [Python](./Python/vowels-of-all-substrings.py)| _O(n)_ | _O(1)_ | Medium | | Combinatorics
2073 | [Time Needed to Buy Tickets](https://leetcode.com/problems/time-needed-to-buy-tickets/)|[C++](./C++/time-needed-to-buy-tickets.cpp) [Python](./Python/time-needed-to-buy-tickets.py)| _O(n)_ | _O(1)_ | Easy | | Simulation, Math
2083 | [Substrings That Begin and End With the Same Letter](https://leetcode.com/problems/substrings-that-begin-and-end-with-the-same-letter/)|[C++](./C++/substrings-that-begin-and-end-with-the-same-letter.cpp) [Python](./Python/substrings-that-begin-and-end-with-the-same-letter.py)| _O(n)_ | _O(1)_ | Medium | š | Combinatorics
2091 | [Removing Minimum and Maximum From Array](https://leetcode.com/problems/removing-minimum-and-maximum-from-array/)|[C++](./C++/removing-minimum-and-maximum-from-array.cpp) [Python](./Python/removing-minimum-and-maximum-from-array.py)| _O(n)_ | _O(1)_ | Medium | | Math
2110 | [Number of Smooth Descent Periods of a Stock](https://leetcode.com/problems/number-of-smooth-descent-periods-of-a-stock/)|[C++](./C++/number-of-smooth-descent-periods-of-a-stock.cpp) [Python](./Python/number-of-smooth-descent-periods-of-a-stock.py)| _O(n)_ | _O(1)_ | Medium | | Math, Combinatorics
2117 | [Abbreviating the Product of a Range](https://leetcode.com/problems/abbreviating-the-product-of-a-range/)|[C++](./C++/abbreviating-the-product-of-a-range.cpp) [Python](./Python/abbreviating-the-product-of-a-range.py)| _O(r - l)_ | _O(1)_ | Hard | | Math
2119 | [A Number After a Double Reversal](https://leetcode.com/problems/a-number-after-a-double-reversal/)|[C++](./C++/a-number-after-a-double-reversal.cpp) [Python](./Python/a-number-after-a-double-reversal.py)| _O(1)_ | _O(1)_ | Easy | | Math
2125 | [Number of Laser Beams in a Bank](https://leetcode.com/problems/number-of-laser-beams-in-a-bank/)|[C++](./C++/number-of-laser-beams-in-a-bank.cpp) [Python](./Python/number-of-laser-beams-in-a-bank.py)| _O(m * n)_ | _O(1)_ | Medium | | Math
2133 | [Check if Every Row and Column Contains All Numbers](https://leetcode.com/problems/check-if-every-row-and-column-contains-all-numbers/)|[C++](./C++/check-if-every-row-and-column-contains-all-numbers.cpp) [Python](./Python/check-if-every-row-and-column-contains-all-numbers.py)| _O(n^2)_ | _O(n)_ | Easy | | Math
2145 | [Count the Hidden Sequences](https://leetcode.com/problems/count-the-hidden-sequences/)|[C++](./C++/count-the-hidden-sequences.cpp) [Python](./Python/count-the-hidden-sequences.py)| _O(n)_ | _O(1)_ | Medium | | Math
2148 | [Count Elements With Strictly Smaller and Greater Elements](https://leetcode.com/problems/count-elements-with-strictly-smaller-and-greater-elements/)|[C++](./C++/count-elements-with-strictly-smaller-and-greater-elements.cpp) [Python](./Python/count-elements-with-strictly-smaller-and-greater-elements.py)| _O(n)_ | _O(1)_ | Easy | | Math
2152 | [Minimum Number of Lines to Cover Points](https://leetcode.com/problems/minimum-number-of-lines-to-cover-points/)|[C++](./C++/minimum-number-of-lines-to-cover-points.cpp) [Python](./Python/minimum-number-of-lines-to-cover-points.py)| _O(n * 2^n)_ | _O(n^2)_ | Medium | š | Math, Hash Table, Bitmasks
2169 | [Count Operations to Obtain Zero](https://leetcode.com/problems/count-operations-to-obtain-zero/)|[C++](./C++/count-operations-to-obtain-zero.cpp) [Python](./Python/count-operations-to-obtain-zero.py)| _O(log(min(m, n)))_ | _O(1)_ | Easy | | Math, `Euclidean Algorithm`
2171 | [Removing Minimum Number of Magic Beans](https://leetcode.com/problems/removing-minimum-number-of-magic-beans/)|[C++](./C++/removing-minimum-number-of-magic-beans.cpp) [Python](./Python/removing-minimum-number-of-magic-beans.py)| _O(nlogn)_ | _O(1)_ | Medium | | Math, Sort
2176 | [Count Equal and Divisible Pairs in an Array](https://leetcode.com/problems/count-equal-and-divisible-pairs-in-an-array/)|[C++](./C++/count-equal-and-divisible-pairs-in-an-array.cpp) [Python](./Python/count-equal-and-divisible-pairs-in-an-array.py)| _O(nlogk + n * sqrt(k))_ | _O(n + sqrt(k))_ | Easy | | Math
2177 | [Find Three Consecutive Integers That Sum to a Given Number](https://leetcode.com/problems/find-three-consecutive-integers-that-sum-to-a-given-number/)|[C++](./C++/find-three-consecutive-integers-that-sum-to-a-given-number.cpp) [Python](./Python/find-three-consecutive-integers-that-sum-to-a-given-number.py)| _O(1)_ | _O(1)_ | Medium | | Math
2180 | [Count Integers With Even Digit Sum](https://leetcode.com/problems/count-integers-with-even-digit-sum/)|[C++](./C++/count-integers-with-even-digit-sum.cpp) [Python](./Python/count-integers-with-even-digit-sum.py)| _O(logn)_ | _O(1)_ | Easy | | Math
2183 | [Count Array Pairs Divisible by K](https://leetcode.com/problems/count-array-pairs-divisible-by-k/)|[C++](./C++/count-array-pairs-divisible-by-k.cpp) [Python](./Python/count-array-pairs-divisible-by-k.py)| _O(nlogk + k)_ | _O(sqrt(k))_ | Hard | variant of [Count Equal and Divisible Pairs in an Array](https://leetcode.com/problems/count-equal-and-divisible-pairs-in-an-array/) | Math
2198 | [Number of Single Divisor Triplets](https://leetcode.com/problems/number-of-single-divisor-triplets/)|[C++](./C++/number-of-single-divisor-triplets.cpp) [Python](./Python/number-of-single-divisor-triplets.py)| _O(d^3)_ | _O(d)_ | Medium | š | Math, Combinatorics
2217 | [Find Palindrome With Fixed Length](https://leetcode.com/problems/find-palindrome-with-fixed-length/)|[C++](./C++/find-palindrome-with-fixed-length.cpp) [Python](./Python/find-palindrome-with-fixed-length.py)| _O(n * l)_ | _O(1)_ | Medium || Math
2221 | [Find Triangular Sum of an Array](https://leetcode.com/problems/find-triangular-sum-of-an-array/)|[C++](./C++/find-triangular-sum-of-an-array.cpp) [Python](./Python/find-triangular-sum-of-an-array.py)| _O(n)_ | _O(1)_ | Medium || Simulation, Combinatorics, Number Thoery
2235 | [Add Two Integers](https://leetcode.com/problems/add-two-integers/)|[C++](./C++/add-two-integers.cpp) [Python](./Python/add-two-integers.py)| _O(1)_ | _O(1)_ | Easy || Math
2240 | [Number of Ways to Buy Pens and Pencils](https://leetcode.com/problems/number-of-ways-to-buy-pens-and-pencils/)|[C++](./C++/number-of-ways-to-buy-pens-and-pencils.cpp) [Python](./Python/number-of-ways-to-buy-pens-and-pencils.py)| _O(sqrt(t))_ | _O(1)_ | Medium || Math
2244 | [Minimum Rounds to Complete All Tasks](https://leetcode.com/problems/minimum-rounds-to-complete-all-tasks/)|[C++](./C++/minimum-rounds-to-complete-all-tasks.cpp) [Python](./Python/minimum-rounds-to-complete-all-tasks.py)| _O(n)_ | _O(n)_ | Medium || Math, Freq Table
2249 | [Count Lattice Points Inside a Circle](https://leetcode.com/problems/count-lattice-points-inside-a-circle/)|[C++](./C++/count-lattice-points-inside-a-circle.cpp) [Python](./Python/count-lattice-points-inside-a-circle.py)| _O(n * r^2)_ | _O(min(n * r^2, max_x * max_y))_ | Medium || Math, Hash Table
2262 | [Total Appeal of A String](https://leetcode.com/problems/total-appeal-of-a-string/)|[C++](./C++/total-appeal-of-a-string.cpp) [Python](./Python/total-appeal-of-a-string.py)| _O(n)_ | _O(26)_ | Hard | variant of [Count Unique Characters of All Substrings of a Given String](https://leetcode.com/problems/count-unique-characters-of-all-substrings-of-a-given-string/) | Combinatorics
2280 | [Minimum Lines to Represent a Line Chart](https://leetcode.com/problems/minimum-lines-to-represent-a-line-chart/)|[C++](./C++/minimum-lines-to-represent-a-line-chart.cpp) [Python](./Python/minimum-lines-to-represent-a-line-chart.py)| _O(nlogn)_ | _O(1)_ | Medium | | Sort, Math, GCD
2310 | [Sum of Numbers With Units Digit K](https://leetcode.com/problems/sum-of-numbers-with-units-digit-k/)|[C++](./C++/sum-of-numbers-with-units-digit-k.cpp) [Python](./Python/sum-of-numbers-with-units-digit-k.py)| _O(1)_ | _O(1)_ | Medium | | Math
2338 | [Count the Number of Ideal Arrays](https://leetcode.com/problems/count-the-number-of-ideal-arrays/)| [C++](./C++/count-the-number-of-ideal-arrays.cpp) [Python](./Python/count-the-number-of-ideal-arrays.py) | _O(sqrt(m) + n + m * (logm + sqrt(m)/log(sqrt(m))))_ | _O(sqrt(m) + n + logm)_ | Hard | variant of [Count Ways to Make Array With Product](https://leetcode.com/problems/count-ways-to-make-array-with-product/) | DP, `Linear Sieve of Eratosthenes`, Factorization, Combinatorics
2344 | [Minimum Deletions to Make Array Divisible](https://leetcode.com/problems/minimum-deletions-to-make-array-divisible/)|[C++](./C++/minimum-deletions-to-make-array-divisible.cpp) [Python](./Python/minimum-deletions-to-make-array-divisible.py)| _O(n + m + logr)_ | _O(1)_ | Hard | | Math, GCD
2345 | [Finding the Number of Visible Mountains](https://leetcode.com/problems/finding-the-number-of-visible-mountains/)|[C++](./C++/finding-the-number-of-visible-mountains.cpp) [Python](./Python/finding-the-number-of-visible-mountains.py)| _O(nlogn)_ | _O(1)_ | Medium | š | Math, Sort, Mono Stack
2376 | [Count Special Integers](https://leetcode.com/problems/count-special-integers/)|[C++](./C++/count-special-integers.cpp) [Python](./Python/count-special-integers.py)| _O(logn)_ | _O(logn)_ | Hard | variant of [Numbers With Repeated Digits](https://leetcode.com/problems/numbers-with-repeated-digits/) | Combinatorics
2396 | [Strictly Palindromic Number](https://leetcode.com/problems/strictly-palindromic-number/)|[C++](./C++/strictly-palindromic-number.cpp) [Python](./Python/strictly-palindromic-number.py)| _O(1)_ | _O(1)_ | Medium || Math
2400 | [Number of Ways to Reach a Position After Exactly k Steps](https://leetcode.com/problems/number-of-ways-to-reach-a-position-after-exactly-k-steps/)|[C++](./C++/number-of-ways-to-reach-a-position-after-exactly-k-steps.cpp) [Python](./Python/number-of-ways-to-reach-a-position-after-exactly-k-steps.py)| _O(k)_ | _O(k)_ | Medium || Combinatorics
2409 | [Count Days Spent Together](https://leetcode.com/problems/count-days-spent-together/) | [C++](./C++/count-days-spent-together.cpp) [Python](./Python/count-days-spent-together.py) | _O(1)_ | _O(1)_ | Easy | | String, Math, Prefix Sum
2413 | [Smallest Even Multiple](https://leetcode.com/problems/smallest-even-multiple/) | [C++](./C++/smallest-even-multiple.cpp) [Python](./Python/smallest-even-multiple.py) | _O(1)_ | _O(1)_ | Easy | | Math, Bit Manipulation
2427 | [Number of Common Factors](https://leetcode.com/problems/number-of-common-factors/) | [C++](./C++/number-of-common-factors.cpp) [Python](./Python/number-of-common-factors.py) | _O(log(min(a, b)) + sqrt(gcd))_ | _O(1)_ | Easy | | Math
2437 | [Number of Valid Clock Times](https://leetcode.com/problems/number-of-valid-clock-times/) | [C++](./C++/number-of-valid-clock-times.cpp) [Python](./Python/number-of-valid-clock-times.py) | _O(1)_ | _O(1)_ | Easy | | Combinatorics
2450 | [Number of Distinct Binary Strings After Applying Operations](https://leetcode.com/problems/number-of-distinct-binary-strings-after-applying-operations/) | [C++](./C++/number-of-distinct-binary-strings-after-applying-operations.cpp) [Python](./Python/number-of-distinct-binary-strings-after-applying-operations.py) | _O(logn)_ | _O(1)_ | Medium | š | Combinatorics
2455 | [Average Value of Even Numbers That Are Divisible by Three](https://leetcode.com/problems/average-value-of-even-numbers-that-are-divisible-by-three/) | [C++](./C++/average-value-of-even-numbers-that-are-divisible-by-three.cpp) [Python](./Python/average-value-of-even-numbers-that-are-divisible-by-three.py) | _O(n)_ | _O(1)_ | Easy | | Math
2468 | [Split Message Based on Limit](https://leetcode.com/problems/split-message-based-on-limit/) | [C++](./C++/split-message-based-on-limit.cpp) [Python](./Python/split-message-based-on-limit.py) | _O(n + rlogr)_ | _O(1)_ | Hard | | Brute Force, Math
2469 | [Convert the Temperature](https://leetcode.com/problems/convert-the-temperature/) | [C++](./C++/convert-the-temperature.cpp) [Python](./Python/convert-the-temperature.py) | _O(1)_ | _O(1)_ | Easy | | Math
2481 | [Minimum Cuts to Divide a Circle](https://leetcode.com/problems/minimum-cuts-to-divide-a-circle/) | [C++](./C++/minimum-cuts-to-divide-a-circle.cpp) [Python](./Python/minimum-cuts-to-divide-a-circle.py) | _O(1)_ | _O(1)_ | Easy | | Math
2485 | [Find the Pivot Integer](https://leetcode.com/problems/find-the-pivot-integer/) | [C++](./C++/find-the-pivot-integer.cpp) [Python](./Python/find-the-pivot-integer.py) | _O(1)_ | _O(1)_ | Easy | | Math
2514 | [Count Anagrams](https://leetcode.com/problems/count-anagrams/) | [C++](./C++/count-anagrams.cpp) [Python](./Python/count-anagrams.py) | _O(n)_ | _O(n)_ | Hard | | Math, Combinatorics
2520 | [Count the Digits That Divide a Number](https://leetcode.com/problems/count-the-digits-that-divide-a-number/) | [C++](./C++/count-the-digits-that-divide-a-number.cpp) [Python](./Python/count-the-digits-that-divide-a-number.py) | _O(logn)_ | _O(1)_ | Easy | | Math
2521 | [Distinct Prime Factors of Product of Array](https://leetcode.com/problems/distinct-prime-factors-of-product-of-array/) | [C++](./C++/distinct-prime-factors-of-product-of-array.cpp) [Python](./Python/distinct-prime-factors-of-product-of-array.py) | precompute: _O(sqrt(MAX_N))_<br>runtime: _O(m + nlog(logn))_ | _O(sqrt(MAX_N))_ | Medium | | Number Theory, `Linear Sieve of Eratosthenes`
2523 | [Closest Prime Numbers in Range](https://leetcode.com/problems/closest-prime-numbers-in-range/) | [C++](./C++/closest-prime-numbers-in-range.cpp) [Python](./Python/closest-prime-numbers-in-range.py) | precompute: _O(MAX_N * log(MAX_N))_<br>runtime: _O(log(MAX_N))_ | _O(MAX_N)_ | Medium | | Number Theory, `Linear Sieve of Eratosthenes`, Segment Tree
2525 | [Categorize Box According to Criteria](https://leetcode.com/problems/categorize-box-according-to-criteria/) | [C++](./C++/categorize-box-according-to-criteria.cpp) [Python](./Python/categorize-box-according-to-criteria.py) | _O(1)_ | _O(1)_ | Easy | | Math
2539 | [Count the Number of Good Subsequences](https://leetcode.com/problems/count-the-number-of-good-subsequences/) | [C++](./C++/count-the-number-of-good-subsequences.cpp) [Python](./Python/count-the-number-of-good-subsequences.py) | _O(26 * n)_ | _O(n)_ | Medium | š | Combinatorics
2543 | [Check if Point Is Reachable](https://leetcode.com/problems/check-if-point-is-reachable/) | [C++](./C++/check-if-point-is-reachable.cpp) [Python](./Python/check-if-point-is-reachable.py) | _O(log(min(a, b)))_ | _O(1)_ | Hard | | Number Theory
2544 | [Alternating Digit Sum](https://leetcode.com/problems/alternating-digit-sum/) | [C++](./C++/alternating-digit-sum.cpp) [Python](./Python/alternating-digit-sum.py) | _O(logn)_ | _O(1)_ | Easy | | Math
2549 | [Count Distinct Numbers on Board](https://leetcode.com/problems/count-distinct-numbers-on-board/) | [C++](./C++/count-distinct-numbers-on-board.cpp) [Python](./Python/count-distinct-numbers-on-board.py) | _O(1)_ | _O(1)_ | Easy | | Math
2550 | [Count Collisions of Monkeys on a Polygon](https://leetcode.com/problems/count-collisions-of-monkeys-on-a-polygon/) | [C++](./C++/count-collisions-of-monkeys-on-a-polygon.cpp) [Python](./Python/count-collisions-of-monkeys-on-a-polygon.py) | _O(logn)_ | _O(1)_ | Medium | | Combinatorics, Fast Exponentiation
2562 | [Find the Array Concatenation Value](https://leetcode.com/problems/find-the-array-concatenation-value/) | [C++](./C++/find-the-array-concatenation-value.cpp) [Python](./Python/find-the-array-concatenation-value.py) | _O(nlogr)_ | _O(1)_ | Easy | | Math
2568 | [Minimum Impossible OR](https://leetcode.com/problems/minimum-impossible-or/) | [C++](./C++/minimum-impossible-or.cpp) [Python](./Python/minimum-impossible-or.py) | _O(logr)_ | _O(1)_ | Medium | | Math, Hash Table, Bit Manipulations
2579 | [Count Total Number of Colored Cells](https://leetcode.com/problems/count-total-number-of-colored-cells/) | [C++](./C++/count-total-number-of-colored-cells.cpp) [Python](./Python/count-total-number-of-colored-cells.py) | _O(1)_ | _O(1)_ | Medium | | Math
2582 | [Pass the Pillow](https://leetcode.com/problems/pass-the-pillow/) | [C++](./C++/pass-the-pillow.cpp) [Python](./Python/pass-the-pillow.py) | _O(1)_ | _O(1)_ | Medium | | Math
2584 | [Split the Array to Make Coprime Products](https://leetcode.com/problems/split-the-array-to-make-coprime-products/) | [C++](./C++/split-the-array-to-make-coprime-products.cpp) [Python](./Python/split-the-array-to-make-coprime-products.py) | _O(n * sqrt(r))_ | _O(sqrt(r))_ | Hard | | Math, Number Theory
2614 | [Prime In Diagonal](https://leetcode.com/problems/prime-in-diagonal/)| [C++](./C++/prime-in-diagonal.cpp) [Python](./Python/prime-in-diagonal.py)| precompute: _O(MAX_N)_<br>runtime: _O(n)_ | _O(MAX_N)_ | Easy | | Number Theory, `Linear Sieve of Eratosthenes` |
2651 | [Calculate Delayed Arrival Time](https://leetcode.com/problems/calculate-delayed-arrival-time/) | [C++](./C++/calculate-delayed-arrival-time.cpp) [Python](./Python/calculate-delayed-arrival-time.py) | _O(1)_ | _O(1)_ | Easy | | Math
2652 | [Sum Multiples](https://leetcode.com/problems/sum-multiples/) | [C++](./C++/sum-multiples.cpp) [Python](./Python/sum-multiples.py) | _O(1)_ | _O(1)_ | Easy | | Math, Principle of Inclusion and Exclusion
2656 | [Maximum Sum With Exactly K Elements](https://leetcode.com/problems/maximum-sum-with-exactly-k-elements/) | [C++](./C++/maximum-sum-with-exactly-k-elements.cpp) [Python](./Python/maximum-sum-with-exactly-k-elements.py) | _O(n)_ | _O(1)_ | Easy | | Math
2731 | [Movement of Robots](https://leetcode.com/problems/movement-of-robots/) | [C++](./C++/movement-of-robots.cpp) [Python](./Python/movement-of-robots.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Math
2739 | [Total Distance Traveled](https://leetcode.com/problems/total-distance-traveled/) | [C++](./C++/total-distance-traveled.cpp) [Python](./Python/total-distance-traveled.py) | _O(1)_ | _O(1)_ | Easy | | Math
2749 | [Minimum Operations to Make the Integer Zero](https://leetcode.com/problems/minimum-operations-to-make-the-integer-zero/) | [C++](./C++/minimum-operations-to-make-the-integer-zero.cpp) [Python](./Python/minimum-operations-to-make-the-integer-zero.py) | _O(1)_ | _O(1)_ | Medium | | Linear Search, Bit Manipulations, Math
2750 | [Ways to Split Array Into Good Subarrays](https://leetcode.com/problems/ways-to-split-array-into-good-subarrays/) | [C++](./C++/ways-to-split-array-into-good-subarrays.cpp) [Python](./Python/ways-to-split-array-into-good-subarrays.py) | _O(n)_ | _O(1)_ | Medium | | Combinatorics
2761 | [Prime Pairs With Target Sum](https://leetcode.com/problems/prime-pairs-with-target-sum/)| [C++](./C++/prime-pairs-with-target-sum.cpp) [Python](./Python/prime-pairs-with-target-sum.py)| _O(n)_ | _O(n)_ | Medium | | Number Theory, `Linear Sieve of Eratosthenes` |
2778 | [Sum of Squares of Special Elements](https://leetcode.com/problems/sum-of-squares-of-special-elements/)| [C++](./C++/sum-of-squares-of-special-elements.cpp) [Python](./Python/sum-of-squares-of-special-elements.py)| _O(sqrt(n))_ | _O(1)_ | Easy | | Number Theory |
2780 | [Minimum Index of a Valid Split](https://leetcode.com/problems/minimum-index-of-a-valid-split/)| [C++](./C++/minimum-index-of-a-valid-split.cpp) [Python](./Python/minimum-index-of-a-valid-split.py)| _O(n)_ | _O(1)_ | Medium | | `BoyerāMoore Majority Vote Algorithm`, Linear Search |
2802 | [Find The K-th Lucky Number](https://leetcode.com/problems/find-the-k-th-lucky-number/)| [C++](./C++/find-the-k-th-lucky-number.cpp) [Python](./Python/find-the-k-th-lucky-number.py)| _O(logn)_ | _O(1)_ | Medium | š | Math, Bitmasks |
2806 | [Account Balance After Rounded Purchase](https://leetcode.com/problems/account-balance-after-rounded-purchase/)| [C++](./C++/account-balance-after-rounded-purchase.cpp) [Python](./Python/account-balance-after-rounded-purchase.py)| _O(1)_ | _O(1)_ | Easy | | Math |
2833 | [Furthest Point From Origin](https://leetcode.com/problems/furthest-point-from-origin/)| [C++](./C++/furthest-point-from-origin.cpp) [Python](./Python/furthest-point-from-origin.py)| _O(1)_ | _O(1)_ | Easy | | Math |
2862 | [Maximum Element-Sum of a Complete Subset of Indices](https://leetcode.com/problems/maximum-element-sum-of-a-complete-subset-of-indices/)| [C++](./C++/maximum-element-sum-of-a-complete-subset-of-indices.cpp) [Python](./Python/maximum-element-sum-of-a-complete-subset-of-indices.py)| _O(n)_ | _O(n)_ | Hard | | Number Theory, `Basel Problem` |
2861 | [Maximum Number of Alloys](https://leetcode.com/problems/maximum-number-of-alloys/) | [C++](./C++/maximum-number-of-alloys.cpp) [Python](./Python/maximum-number-of-alloys.py) | _O(k * nlogn)_ | _O(n)_ | Medium | | Binary Search, Sort, Math |
2894 | [Divisible and Non-divisible Sums Difference](https://leetcode.com/problems/divisible-and-non-divisible-sums-difference/) | [C++](./C++/divisible-and-non-divisible-sums-difference.cpp) [Python](./Python/divisible-and-non-divisible-sums-difference.py) | _O(1)_ | _O(1)_ | Easy | | Math |
2898 | [Maximum Linear Stock Score](https://leetcode.com/problems/maximum-linear-stock-score/) | [C++](./C++/maximum-linear-stock-score.cpp) [Python](./Python/maximum-linear-stock-score.py) | _O(n)_ | _O(n)_ | Medium | š | Math, Freq Table |
2927 | [Distribute Candies Among Children III](https://leetcode.com/problems/distribute-candies-among-children-iii/) | [C++](./C++/distribute-candies-among-children-iii.cpp) [Python](./Python/distribute-candies-among-children-iii.py) | _O(1)_ | _O(1)_ | Hard | š | Stars and Bars, Combinatorics, Principle of Inclusion and Exclusion |
2928 | [Distribute Candies Among Children I](https://leetcode.com/problems/distribute-candies-among-children-i/) | [C++](./C++/distribute-candies-among-children-i.cpp) [Python](./Python/distribute-candies-among-children-i.py) | _O(1)_ | _O(1)_ | Easy | | Stars and Bars, Combinatorics, Principle of Inclusion and Exclusion, Brute Force |
2929 | [Distribute Candies Among Children II](https://leetcode.com/problems/distribute-candies-among-children-ii/) | [C++](./C++/distribute-candies-among-children-ii.cpp) [Python](./Python/distribute-candies-among-children-ii.py) | _O(1)_ | _O(1)_ | Medium | | Stars and Bars, Combinatorics, Principle of Inclusion and Exclusion, Brute Force |
2930 | [Number of Strings Which Can Be Rearranged to Contain Substring](https://leetcode.com/problems/number-of-strings-which-can-be-rearranged-to-contain-substring/) | [C++](./C++/number-of-strings-which-can-be-rearranged-to-contain-substring.cpp) [Python](./Python/number-of-strings-which-can-be-rearranged-to-contain-substring.py) | _O(1)_ | _O(1)_ | Medium | | Combinatorics, Principle of Inclusion and Exclusion, Bitmasks, DP |
2954 | [Count the Number of Infection Sequences](https://leetcode.com/problems/count-the-number-of-infection-sequences/) | [C++](./C++/count-the-number-of-infection-sequences.cpp) [Python](./Python/count-the-number-of-infection-sequences.py) | precompute: _O(max_n)_<br>runtime: _O(s + logn)_ | _O(max_n)_ | Hard | | Combinatorics |
2961 | [Double Modular Exponentiation](https://leetcode.com/problems/double-modular-exponentiation/) | [C++](./C++/double-modular-exponentiation.cpp) [Python](./Python/double-modular-exponentiation.py) | _O(n * (logb + logc))_ | _O(1)_ | Medium | | Fast Exponentiation |
2963 | [Count the Number of Good Partitions](https://leetcode.com/problems/count-the-number-of-good-partitions/) | [C++](./C++/count-the-number-of-good-partitions.cpp) [Python](./Python/count-the-number-of-good-partitions.py) | _O(n)_ | _O(n)_ | Hard | | Hash Table, Combinatorics |
2979 | [Most Expensive Item That Can Not Be Bought](https://leetcode.com/problems/most-expensive-item-that-can-not-be-bought/) | [C++](./C++/most-expensive-item-that-can-not-be-bought.cpp) [Python](./Python/most-expensive-item-that-can-not-be-bought.py) | _O(1)_ | _O(1)_ | Medium | š | `Frobenius Coin Problem`, `Chicken McNugget Theorem`, DP |
2999 | [Count the Number of Powerful Integers](https://leetcode.com/problems/count-the-number-of-powerful-integers/) | [C++](./C++/count-the-number-of-powerful-integers.cpp) [Python](./Python/count-the-number-of-powerful-integers.py) | _O(logf)_ | _O(1)_ | Hard || Math, Combinatorics |
3001 | [Minimum Moves to Capture The Queen](https://leetcode.com/problems/minimum-moves-to-capture-the-queen/) | [C++](./C++/minimum-moves-to-capture-the-queen.cpp) [Python](./Python/minimum-moves-to-capture-the-queen.py) | _O(1)_ | _O(1)_ | Medium || Math |
3007 | [Maximum Number That Sum of the Prices Is Less Than or Equal to K](https://leetcode.com/problems/maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/) | [C++](./C++/maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k.cpp) [Python](./Python/maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k.py) | _O(max(logk, x) * log((logk) / x))_ | _O((logk) / x)_ | Medium || Bit Manipulation, Binary Search, Combinatorics |
3021 | [Alice and Bob Playing Flower Game](https://leetcode.com/problems/alice-and-bob-playing-flower-game/) | [C++](./C++/alice-and-bob-playing-flower-game.cpp) [Python](./Python/alice-and-bob-playing-flower-game.py) | _O(1)_ | _O(1)_ | Medium || Combinatorics |
3024 | [Type of Triangle II](https://leetcode.com/problems/type-of-triangle-ii/) | [C++](./C++/type-of-triangle-ii.cpp) [Python](./Python/type-of-triangle-ii.py) | _O(1)_ | _O(1)_ | Easy || Math |
3032 | [Count Numbers With Unique Digits II](https://leetcode.com/problems/count-numbers-with-unique-digits-ii/) | [C++](./C++/count-numbers-with-unique-digits-ii.cpp) [Python](./Python/count-numbers-with-unique-digits-ii.py) | _O(logb)_ | _O(1)_ | Easy |š, variant of [Count Numbers With Unique Digits](https://leetcode.com/problems/count-numbers-with-unique-digits/) | Brute Force, Hash Table, Bitmasks, Combinatorics
3047 | [Find the Largest Area of Square Inside Two Rectangles](https://leetcode.com/problems/find-the-largest-area-of-square-inside-two-rectangles/) | [C++](./C++/find-the-largest-area-of-square-inside-two-rectangles.cpp) [Python](./Python/find-the-largest-area-of-square-inside-two-rectangles.py) | _O(n^2)_ | _O(1)_ | Meidum || Brute Force, Math |
3084 | [Count Substrings Starting and Ending with Given Character](https://leetcode.com/problems/count-substrings-starting-and-ending-with-given-character/) | [C++](./C++/count-substrings-starting-and-ending-with-given-character.cpp) [Python](./Python/count-substrings-starting-and-ending-with-given-character.py) | _O(n)_ | _O(1)_ | Meidum || Combinatorics |
3091 | [Apply Operations to Make Sum of Array Greater Than or Equal to k](https://leetcode.com/problems/apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k/) | [C++](./C++/apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k.cpp) [Python](./Python/apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k.py) | _O(logn)_ | _O(1)_ | Meidum | [Codeforces Round #674 C](https://codeforces.com/contest/1426/problem/C) | Math |
3099 | [Harshad Number](https://leetcode.com/problems/harshad-number/) | [C++](./C++/harshad-number.cpp) [Python](./Python/harshad-number.py) | _O(logx)_ | _O(1)_ | Easy | | Math |
3102 | [Minimize Manhattan Distances](https://leetcode.com/problems/minimize-manhattan-distances/) | [C++](./C++/minimize-manhattan-distances.cpp) [Python](./Python/minimize-manhattan-distances.py) | _O(n)_ | _O(1)_ | Hard | | Math |
3115 | [Maximum Prime Difference](https://leetcode.com/problems/maximum-prime-difference/) | [C++](./C++/maximum-prime-difference.cpp) [Python](./Python/maximum-prime-difference.py) | _O(r + n)_ | _O(r)_ | Medium | | Array, Number Theory, `Linear Sieve of Eratosthenes` |
3128 | [Right Triangles](https://leetcode.com/problems/right-triangles/) | [C++](./C++/right-triangles.cpp) [Python](./Python/right-triangles.py) | _O(n * m)_ | _O(min(n, m))_ | Medium | | Array, Combinatorics, Freq Table |
3154 | [Find Number of Ways to Reach the K-th Stair](https://leetcode.com/problems/find-number-of-ways-to-reach-the-k-th-stair/) | [C++](./C++/find-number-of-ways-to-reach-the-k-th-stair.cpp) [Python](./Python/find-number-of-ways-to-reach-the-k-th-stair.py) | _O(logk)_ | _O(logk)_ | Hard | | Combinatorics |
3155 | [Maximum Number of Upgradable Servers](https://leetcode.com/problems/maximum-number-of-upgradable-servers/) | [C++](./C++/maximum-number-of-upgradable-servers.cpp) [Python](./Python/maximum-number-of-upgradable-servers.py) | _O(n)_ | _O(1)_ | Medium | š | Math |
3162 | [Find the Number of Good Pairs I](https://leetcode.com/problems/find-the-number-of-good-pairs-i/) | [C++](./C++/find-the-number-of-good-pairs-i.cpp) [Python](./Python/find-the-number-of-good-pairs-i.py) | _O(rlogr + n + m)_ | _O(r)_ | Easy | | Brute Force, Number Theory, Freq Table |
3164 | [Find the Number of Good Pairs II](https://leetcode.com/problems/find-the-number-of-good-pairs-ii/) | [C++](./C++/find-the-number-of-good-pairs-ii.cpp) [Python](./Python/find-the-number-of-good-pairs-ii.py) | _O(rlogr + n + m)_ | _O(r)_ | Medium | | Number Theory, Freq Table |
3178 | [Find the Child Who Has the Ball After K Seconds](https://leetcode.com/problems/find-the-child-who-has-the-ball-after-k-seconds/) | [C++](./C++/find-the-child-who-has-the-ball-after-k-seconds.cpp) [Python](./Python/find-the-child-who-has-the-ball-after-k-seconds.py) | _O(1)_ | _O(1)_ | Easy | | Math |
3179 | [Find the N-th Value After K Seconds](https://leetcode.com/problems/find-the-n-th-value-after-k-seconds/) | [C++](./C++/find-the-n-th-value-after-k-seconds.cpp) [Python](./Python/find-the-n-th-value-after-k-seconds.py) | _O(n + k)_ | _O(n + k)_ | Medium | | Prefix Sum, Combinatorics |
3183 | [The Number of Ways to Make the Sum](https://leetcode.com/problems/the-number-of-ways-to-make-the-sum/) | [C++](./C++/the-number-of-ways-to-make-the-sum.cpp) [Python](./Python/the-number-of-ways-to-make-the-sum.py) | _O(1)_ | _O(1)_ | Medium | š | Math, DP |
3190 | [Find Minimum Operations to Make All Elements Divisible by Three](https://leetcode.com/problems/find-minimum-operations-to-make-all-elements-divisible-by-three/) | [C++](./C++/find-minimum-operations-to-make-all-elements-divisible-by-three.cpp) [Python](./Python/find-minimum-operations-to-make-all-elements-divisible-by-three.py) | _O(n)_ | _O(1)_ | Easy | | Math |
3200 | [Maximum Height of a Triangle](https://leetcode.com/problems/maximum-height-of-a-triangle/) | [C++](./C++/maximum-height-of-a-triangle.cpp) [Python](./Python/maximum-height-of-a-triangle.py) | _O(logn)_ | _O(1)_ | Easy | | Simulation, Math |
3222 | [Find the Winning Player in Coin Game](https://leetcode.com/problems/find-the-winning-player-in-coin-game/) | [C++](./C++/find-the-winning-player-in-coin-game.cpp) [Python](./Python/find-the-winning-player-in-coin-game.py) | _O(1)_ | _O(1)_ | Easy | | Math |
3227 | [Vowels Game in a String](https://leetcode.com/problems/vowels-game-in-a-string/) | [C++](./C++/vowels-game-in-a-string.cpp) [Python](./Python/vowels-game-in-a-string.py) | _O(n)_ | _O(1)_ | Medium | | Math |
3232 | [Find if Digit Game Can Be Won](https://leetcode.com/problems/find-if-digit-game-can-be-won/) | [C++](./C++/find-if-digit-game-can-be-won.cpp) [Python](./Python/find-if-digit-game-can-be-won.py) | _O(n)_ | _O(1)_ | Easy | | Brute Force, Game Theory |
3247 | [Number of Subsequences with Odd Sum](https://leetcode.com/problems/number-of-subsequences-with-odd-sum/) | [C++](./C++/number-of-subsequences-with-odd-sum.cpp) [Python](./Python/number-of-subsequences-with-odd-sum.py) | _O(n)_ | _O(1)_ | Medium | š | Combinatorics, Fast Exponentiation, DP |
3250 | [Find the Count of Monotonic Pairs I](https://leetcode.com/problems/find-the-count-of-monotonic-pairs-i/) | [C++](./C++/find-the-count-of-monotonic-pairs-i.cpp) [Python](./Python/find-the-count-of-monotonic-pairs-i.py) | _O(n + r)_ | _O(n + r)_ | Hard | | Combinatorics, Stars and Bars, DP, Prefix Sum |
3251 | [Find the Count of Monotonic Pairs II](https://leetcode.com/problems/find-the-count-of-monotonic-pairs-ii/) | [C++](./C++/find-the-count-of-monotonic-pairs-ii.cpp) [Python](./Python/find-the-count-of-monotonic-pairs-ii.py) | _O(n + r)_ | _O(n + r)_ | Hard | | Combinatorics, Stars and Bars, DP, Prefix Sum |
3270 | [Find the Key of the Numbers](https://leetcode.com/problems/find-the-key-of-the-numbers/) | [C++](./C++/find-the-key-of-the-numbers.cpp) [Python](./Python/find-the-key-of-the-numbers.py) | _O(d)_ | _O(1)_ | Easy | | Math |
3272 | [Find the Count of Good Integers](https://leetcode.com/problems/find-the-count-of-good-integers/) | [C++](./C++/find-the-count-of-good-integers.cpp) [Python](./Python/find-the-count-of-good-integers.py) | _O(n + 10 * 10^((n + 1)/2))_ | _O(n + 10 * (10 * nHr(10, n/2)))_ | Hard | | Combinatorics, Freq Table |
3274 | [Check if Two Chessboard Squares Have the Same Color](https://leetcode.com/problems/check-if-two-chessboard-squares-have-the-same-color/) | [C++](./C++/check-if-two-chessboard-squares-have-the-same-color.cpp) [Python](./Python/check-if-two-chessboard-squares-have-the-same-color.py) | _O(1)_ | _O(1)_ | Easy | | Math, Parity |
3284 | [Sum of Consecutive Subarrays](https://leetcode.com/problems/sum-of-consecutive-subarrays/) | [C++](./C++/sum-of-consecutive-subarrays.cpp) [Python](./Python/sum-of-consecutive-subarrays.py) | _O(n)_ | _O(1)_ | Medium | š | Combinatorics |
3299 | [Sum of Consecutive Subsequences](https://leetcode.com/problems/sum-of-consecutive-subsequences/) | [C++](./C++/sum-of-consecutive-subsequences.cpp) [Python](./Python/sum-of-consecutive-subsequences.py) | _O(n)_ | _O(n)_ | Hard | š | Combinatorics, Prefix Sum, DP |
3312 | [Sorted GCD Pair Queries](https://leetcode.com/problems/sorted-gcd-pair-queries/) | [C++](./C++/sorted-gcd-pair-queries.cpp) [Python](./Python/sorted-gcd-pair-queries.py) | _O(rlogr + qlogr)_ | _O(r)_ | Hard | | Number Theory, Freq Table, Prefix Sum, Binary Search |
3317 | [Find the Number of Possible Ways for an Event](https://leetcode.com/problems/find-the-number-of-possible-ways-for-an-event/) | [C++](./C++/find-the-number-of-possible-ways-for-an-event.cpp) [Python](./Python/find-the-number-of-possible-ways-for-an-event.py) | precompute: _O(max_n^2 + max_y * min(max_n, max_x))_<br>runtime: _O(min(n, x))_ | _O(max_n^2 + max_y * min(max_n, max_x))_ | Hard | | DP, Combinatorics |
3326 | [Minimum Division Operations to Make Array Non Decreasing](https://leetcode.com/problems/minimum-division-operations-to-make-array-non-decreasing/) | [C++](./C++/minimum-division-operations-to-make-array-non-decreasing.cpp) [Python](./Python/minimum-division-operations-to-make-array-non-decreasing.py) | precompute: _O(r)_<br>runtime: _O(n)_ | _O(r)_ | Medium | | Greedy, Number Theory, `Linear Sieve of Eratosthenes` |
3339 | [Find the Number of K-Even Arrays](https://leetcode.com/problems/find-the-number-of-k-even-arrays/) | [C++](./C++/find-the-number-of-k-even-arrays.cpp) [Python](./Python/find-the-number-of-k-even-arrays.py) | _O(n)_ | _O(n)_ | Medium | š | DP, Stars and Bars, Combinatorics |
3345 | [Smallest Divisible Digit Product I](https://leetcode.com/problems/smallest-divisible-digit-product-i/) | [C++](./C++/smallest-divisible-digit-product-i.cpp) [Python](./Python/smallest-divisible-digit-product-i.py) | _O(logn)_ | _O(1)_ | Easy | | Brute Force |
3348 | [Smallest Divisible Digit Product II](https://leetcode.com/problems/smallest-divisible-digit-product-ii/) | [C++](./C++/smallest-divisible-digit-product-ii.cpp) [Python](./Python/smallest-divisible-digit-product-ii.py) | _O(n + logt)_ | _O(1)_ | Hard | | Freq Table, Greedy, Prefix Sum, Number Theory |
3360 | [Stone Removal Game](https://leetcode.com/problems/stone-removal-game/) | [C++](./C++/stone-removal-game.cpp) [Python](./Python/stone-removal-game.py) | _O(1)_ | _O(1)_ | Easy | | Math |
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Sort
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2015 | [Average Height of Buildings in Each Segment](https://leetcode.com/problems/average-height-of-buildings-in-each-segment/) | [C++](./C++/average-height-of-buildings-in-each-segment.cpp) [Python](./Python/average-height-of-buildings-in-each-segment.py) | _O(nlogn)_ | _O(n)_ | Medium | š | Line Sweep
2021 | [Brightest Position on Street](https://leetcode.com/problems/brightest-position-on-street/) | [C++](./C++/brightest-position-on-street.cpp) [Python](./Python/brightest-position-on-street.py) | _O(nlogn)_ | _O(n)_ | Medium | š | Line Sweep
2070 | [Most Beautiful Item for Each Query](https://leetcode.com/problems/most-beautiful-item-for-each-query/) | [C++](./C++/most-beautiful-item-for-each-query.cpp) [Python](./Python/most-beautiful-item-for-each-query.py) | _O(nlogn + qlogn)_ | _O(1)_ | Medium | | Sort, Binary Search |
2089 | [Find Target Indices After Sorting Array](https://leetcode.com/problems/find-target-indices-after-sorting-array/) | [C++](./C++/find-target-indices-after-sorting-array.cpp) [Python](./Python/find-target-indices-after-sorting-array.py) | _O(n)_ | _O(1)_ | Easy | | Counting Sort |
2158 | [Amount of New Area Painted Each Day](https://leetcode.com/problems/amount-of-new-area-painted-each-day/) | [C++](./C++/amount-of-new-area-painted-each-day.cpp) [Python](./Python/amount-of-new-area-painted-each-day.py) | _O(nlogr)_ | _O(r)_ | Hard | š | Line Sweep, Sorted List, Heap, Segment Tree
2164 | [Sort Even and Odd Indices Independently](https://leetcode.com/problems/sort-even-and-odd-indices-independently/) | [C++](./C++/sort-even-and-odd-indices-independently.cpp) [Python](./Python/sort-even-and-odd-indices-independently.py) | _O(n)_ | _O(c)_ | Easy | | Counting Sort, Inplace |
2191 | [Sort the Jumbled Numbers](https://leetcode.com/problems/sort-the-jumbled-numbers/) | [C++](./C++/sort-the-jumbled-numbers.cpp) [Python](./Python/sort-the-jumbled-numbers.py) | _O(nlogm + nlogn)_ | _O(n)_ | Medium | | Sort |
2231 | [Largest Number After Digit Swaps by Parity](https://leetcode.com/problems/largest-number-after-digit-swaps-by-parity/) | [C++](./C++/largest-number-after-digit-swaps-by-parity.cpp) [Python](./Python/largest-number-after-digit-swaps-by-parity.py) | _O(logn)_ | _O(1)_ | Easy | | Counting Sort |
2233 | [Maximum Product After K Increments](https://leetcode.com/problems/maximum-product-after-k-increments/)|[C++](./C++/maximum-product-after-k-increments.cpp) [Python](./Python/maximum-product-after-k-increments.py)| _O(n + k)_ | _O(n)_ | Medium || Heap, Freq Table, Sort, Math
2248 | [Intersection of Multiple Arrays](https://leetcode.com/problems/intersection-of-multiple-arrays/)|[C++](./C++/intersection-of-multiple-arrays.cpp) [Python](./Python/intersection-of-multiple-arrays.py)| _O(n * l + r)_ | _O(l)_ | Easy || Hash Table, Counting Sort
2251 | [Number of Flowers in Full Bloom](https://leetcode.com/problems/number-of-flowers-in-full-bloom/) | [C++](./C++/number-of-flowers-in-full-bloom.cpp) [Python](./Python/number-of-flowers-in-full-bloom.py) | _O(nlogn + mlogn)_ | _O(n)_ | Hard | | Line Sweep, Binary Search
2343 | [Query Kth Smallest Trimmed Number](https://leetcode.com/problems/query-kth-smallest-trimmed-number/) | [C++](./C++/query-kth-smallest-trimmed-number.cpp) [Python](./Python/query-kth-smallest-trimmed-number.py) | _O(q + n * t)_ | _O(t + n + q)_ | Medium | | Sort, Quick Select, Radix Sort
2418 | [Sort the People](https://leetcode.com/problems/sort-the-people/) | [C++](./C++/sort-the-people.cpp) [Python](./Python/sort-the-people.py) | _O(nlogn)_ | _O(n)_ | Easy | | Sort
2497 | [Maximum Star Sum of a Graph](https://leetcode.com/problems/maximum-star-sum-of-a-graph/) | [C++](./C++/maximum-star-sum-of-a-graph.cpp) [Python](./Python/maximum-star-sum-of-a-graph.py) | _O(n)_ | _O(n)_ | Medium | | Sort, Quick Select
2512 | [Reward Top K Students](https://leetcode.com/problems/reward-top-k-students/) | [C++](./C++/reward-top-k-students.cpp) [Python](./Python/reward-top-k-students.py) | _O(pf * l + nf * l + n * l + klogk)_ | _O(pf * l + nf * l + n)_ | Medium | | Partial Sort, Quick Select
2545 | [Sort the Students by Their Kth Score](https://leetcode.com/problems/sort-the-students-by-their-kth-score/) | [C++](./C++/sort-the-students-by-their-kth-score.cpp) [Python](./Python/sort-the-students-by-their-kth-score.py) | _O(mlogm)_ | _O(1)_ | Medium | | Sort
2659 | [Make Array Empty](https://leetcode.com/problems/make-array-empty/) | [C++](./C++/make-array-empty.cpp) [Python](./Python/make-array-empty.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sort, BIT, Fenwick Tree
2679 | [Sum in a Matrix](https://leetcode.com/problems/sum-in-a-matrix/) | [C++](./C++/sum-in-a-matrix.cpp) [Python](./Python/sum-in-a-matrix.py) | _O(m * nlogn)_ | _O(1)_ | Medium | | Sort
2740 | [Find the Value of the Partition](https://leetcode.com/problems/find-the-value-of-the-partition/) | [C++](./C++/find-the-value-of-the-partition.cpp) [Python](./Python/find-the-value-of-the-partition.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort
2785 | [Sort Vowels in a String](https://leetcode.com/problems/sort-vowels-in-a-string/) | [C++](./C++/sort-vowels-in-a-string.cpp) [Python](./Python/sort-vowels-in-a-string.py) | _O(n)_ | _O(1)_ | Medium | | Counting Sort
2792 | [Count Nodes That Are Great Enough](https://leetcode.com/problems/count-nodes-that-are-great-enough/) | [C++](./C++/count-nodes-that-are-great-enough.cpp) [Python](./Python/count-nodes-that-are-great-enough.py) | _O(k * h)_ | _O(k + h)_ | Hard | š | Merge Sort
2948 | [Make Lexicographically Smallest Array by Swapping Elements](https://leetcode.com/problems/make-lexicographically-smallest-array-by-swapping-elements/) | [C++](./C++/make-lexicographically-smallest-array-by-swapping-elements.cpp) [Python](./Python/make-lexicographically-smallest-array-by-swapping-elements.py) | _O(nlogn)_ | _O(n)_ | Medium | | Sort
2974 | [Minimum Number Game](https://leetcode.com/problems/minimum-number-game/) | [C++](./C++/minimum-number-game.cpp) [Python](./Python/minimum-number-game.py) | _O(nlogn)_ | _O(1)_ | Easy | | Sort
3011 | [Find if Array Can Be Sorted](https://leetcode.com/problems/find-if-array-can-be-sorted/) | [C++](./C++/find-if-array-can-be-sorted.cpp) [Python](./Python/find-if-array-can-be-sorted.py) | _O(n)_ | _O(1)_ | Medium | | Sort
3025 | [Find the Number of Ways to Place People I](https://leetcode.com/problems/find-the-number-of-ways-to-place-people-i/) | [C++](./C++/find-the-number-of-ways-to-place-people-i.cpp) [Python](./Python/find-the-number-of-ways-to-place-people-i.py) | _O(n^2)_ | _O(1)_ | Medium | | Sort, Array
3027 | [Find the Number of Ways to Place People II](https://leetcode.com/problems/find-the-number-of-ways-to-place-people-ii/) | [C++](./C++/find-the-number-of-ways-to-place-people-ii.cpp) [Python](./Python/find-the-number-of-ways-to-place-people-ii.py) | _O(n^2)_ | _O(1)_ | Hard | | Sort, Array
3081 | [Replace Question Marks in String to Minimize Its Value](https://leetcode.com/problems/replace-question-marks-in-string-to-minimize-its-value/) | [C++](./C++/replace-question-marks-in-string-to-minimize-its-value.cpp) [Python](./Python/replace-question-marks-in-string-to-minimize-its-value.py) | _O(n + 26 * log(26))_ | _O(n + 26)_ | Medium | | Greedy, Counting Sort, Heap, Prefix Sum
3132 | [Find the Integer Added to Array II](https://leetcode.com/problems/find-the-integer-added-to-array-ii/) | [C++](./C++/find-the-integer-added-to-array-ii.cpp) [Python](./Python/find-the-integer-added-to-array-ii.py) | _O(n)_ | _O(n)_ | Medium | | Sort, Paritial Sort, Freq Table
3169 | [Count Days Without Meetings](https://leetcode.com/problems/count-days-without-meetings/) | [C++](./C++/count-days-without-meetings.cpp) [Python](./Python/count-days-without-meetings.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort
3194 | [Minimum Average of Smallest and Largest Elements](https://leetcode.com/problems/minimum-average-of-smallest-and-largest-elements/) | [C++](./C++/minimum-average-of-smallest-and-largest-elements.cpp) [Python](./Python/minimum-average-of-smallest-and-largest-elements.py) | _O(nlogn)_ | _O(1)_ | Easy | | Sort
3309 | [Maximum Possible Number by Binary Concatenation](https://leetcode.com/problems/maximum-possible-number-by-binary-concatenation/) | [C++](./C++/maximum-possible-number-by-binary-concatenation.cpp) [Python](./Python/maximum-possible-number-by-binary-concatenation.py) | _O(n * logr * logn)_ | _O(nlogr)_ | Medium | | Sort, Brute Force
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Two Pointers
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2009 | [Minimum Number of Operations to Make Array Continuous](https://leetcode.com/problems/minimum-number-of-operations-to-make-array-continuous/) | [C++](./C++/minimum-number-of-operations-to-make-array-continuous.cpp) [Python](./Python/minimum-number-of-operations-to-make-array-continuous.py) | _O(nlogn)_ | _O(1)_ | Hard || Two Pointers, Sliding Window
2024 | [Maximize the Confusion of an Exam](https://leetcode.com/problems/maximize-the-confusion-of-an-exam/) | [C++](./C++/maximize-the-confusion-of-an-exam.cpp) [Python](./Python/maximize-the-confusion-of-an-exam.py) | _O(n)_| _O(1)_| Medium | variant of [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | Sliding Window |
2040 | [Kth Smallest Product of Two Sorted Arrays](https://leetcode.com/problems/kth-smallest-product-of-two-sorted-arrays/) | [C++](./C++/kth-smallest-product-of-two-sorted-arrays.cpp) [Python](./Python/kth-smallest-product-of-two-sorted-arrays.py) | _O((m + n) * logr)_| _O(1)_| Hard | | Binary Search, Two Pointers |
2046 | [Sort Linked List Already Sorted Using Absolute Values](https://leetcode.com/problems/sort-linked-list-already-sorted-using-absolute-values/)| [C++](./C++/sort-linked-list-already-sorted-using-absolute-values.cpp) [Python](./Python/sort-linked-list-already-sorted-using-absolute-values.py) | _O(n)_ | _O(1)_ | Medium | š | Linked List
2062 | [Count Vowel Substrings of a String](https://leetcode.com/problems/count-vowel-substrings-of-a-string/) | [C++](./C++/count-vowel-substrings-of-a-string.cpp) [Python](./Python/count-vowel-substrings-of-a-string.py) | _O(n)_ | _O(1)_ | Easy | variant of [Count Number of Nice Subarrays](https://leetcode.com/problems/count-number-of-nice-subarrays/) | Sliding Window
2067 | [Number of Equal Count Substrings](https://leetcode.com/problems/number-of-equal-count-substrings/) | [C++](./C++/number-of-equal-count-substrings.cpp) [Python](./Python/number-of-equal-count-substrings.py) | _O(n)_ | _O(1)_ | Medium | š | Sliding Window
2090 | [K Radius Subarray Averages](https://leetcode.com/problems/k-radius-subarray-averages/) | [C++](./C++/k-radius-subarray-averages.cpp) [Python](./Python/k-radius-subarray-averages.py) | _O(n)_ | _O(1)_ | Medium || Sliding Window
2105 | [Watering Plants II](https://leetcode.com/problems/watering-plants-ii/) | [C++](./C++/watering-plants-ii.cpp) [Python](./Python/watering-plants-ii.py) | _O(n)_ | _O(1)_ | Medium || Simulation
2107 | [Number of Unique Flavors After Sharing K Candies](https://leetcode.com/problems/number-of-unique-flavors-after-sharing-k-candies/) | [C++](./C++/number-of-unique-flavors-after-sharing-k-candies.cpp) [Python](./Python/number-of-unique-flavors-after-sharing-k-candies.py) | _O(n)_ | _O(n)_ | Medium | š | Sliding Window
2134 | [Minimum Swaps to Group All 1's Together II](https://leetcode.com/problems/minimum-swaps-to-group-all-1s-together-ii/) | [C++](./C++/minimum-swaps-to-group-all-1s-together-ii.cpp) [Python](./Python/minimum-swaps-to-group-all-1s-together-ii.py) | _O(n)_ | _O(1)_ | Medium | | Sliding Window
2149 | [Rearrange Array Elements by Sign](https://leetcode.com/problems/rearrange-array-elements-by-sign/) | [C++](./C++/rearrange-array-elements-by-sign.cpp) [Python](./Python/rearrange-array-elements-by-sign.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers
2161 | [Partition Array According to Given Pivot](https://leetcode.com/problems/partition-array-according-to-given-pivot/) | [C++](./C++/partition-array-according-to-given-pivot.cpp) [Python](./Python/partition-array-according-to-given-pivot.py) | _O(n)_ | _O(n)_ | Medium | | Two Pointers
2200 | [Find All K-Distant Indices in an Array](https://leetcode.com/problems/find-all-k-distant-indices-in-an-array/) | [C++](./C++/find-all-k-distant-indices-in-an-array.cpp) [Python](./Python/find-all-k-distant-indices-in-an-array.py) | _O(n)_ | _O(1)_ | Easy | | Two Pointers
2234 | [Maximum Total Beauty of the Gardens](https://leetcode.com/problems/maximum-total-beauty-of-the-gardens/) | [C++](./C++/maximum-total-beauty-of-the-gardens.cpp) [Python](./Python/maximum-total-beauty-of-the-gardens.py) | _O(nlogn)_ | _O(1)_ | Hard | | Sort, Prefix Sum, Greedy, Binary Search, Two Pointers
2302 | [Count Subarrays With Score Less Than K](https://leetcode.com/problems/count-subarrays-with-score-less-than-k/) | [C++](./C++/count-subarrays-with-score-less-than-k.cpp) [Python](./Python/count-subarrays-with-score-less-than-k.py) | _O(n)_ | _O(1)_ | Hard | | Two Pointers, Sliding Window
2330 | [Valid Palindrome IV](https://leetcode.com/problems/valid-palindrome-iv/) | [C++](./C++/valid-palindrome-iv.cpp) [Python](./Python/valid-palindrome-iv.py) | _O(n)_ | _O(1)_ | Medium | š | String, Two Pointers |
2332 | [The Latest Time to Catch a Bus](https://leetcode.com/problems/the-latest-time-to-catch-a-bus/) | [C++](./C++/the-latest-time-to-catch-a-bus.cpp) [Python](./Python/the-latest-time-to-catch-a-bus.py) | _O(nlogn + mlogm)_ | _O(1)_ | Medium | | String, Two Pointers |
2337 | [Move Pieces to Obtain a String](https://leetcode.com/problems/move-pieces-to-obtain-a-string/) | [C++](./C++/move-pieces-to-obtain-a-string.cpp) [Python](./Python/move-pieces-to-obtain-a-string.py) | _O(n + m)_ | _O(1)_ | Medium | | String, Two Pointers |
2348 | [Number of Zero-Filled Subarrays](https://leetcode.com/problems/number-of-zero-filled-subarrays/) | [C++](./C++/number-of-zero-filled-subarrays.cpp) [Python](./Python/number-of-zero-filled-subarrays.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers, Combinatorics |
2379 | [Minimum Recolors to Get K Consecutive Black Blocks](https://leetcode.com/problems/minimum-recolors-to-get-k-consecutive-black-blocks/) | [C++](./C++/minimum-recolors-to-get-k-consecutive-black-blocks.cpp) [Python](./Python/minimum-recolors-to-get-k-consecutive-black-blocks.py) | _O(n)_ | _O(1)_ | Easy | | Sliding Window
2393 | [Count Strictly Increasing Subarrays](https://leetcode.com/problems/count-strictly-increasing-subarrays/) | [C++](./C++/count-strictly-increasing-subarrays.cpp) [Python](./Python/count-strictly-increasing-subarrays.py) | _O(n)_ | _O(1)_ | Medium | š | Two Pointers |
2401 | [Longest Nice Subarray](https://leetcode.com/problems/longest-nice-subarray/) | [C++](./C++/longest-nice-subarray.cpp) [Python](./Python/longest-nice-subarray.py) | _O(n)_ | _O(1)_ | Medium | | Sliding Window, Two Pointers |
2444 | [Count Subarrays With Fixed Bounds](https://leetcode.com/problems/count-subarrays-with-fixed-bounds/) | [C++](./C++/count-subarrays-with-fixed-bounds.cpp) [Python](./Python/count-subarrays-with-fixed-bounds.py) | _O(n)_ | _O(1)_ | Hard | variant of [Number of Substrings Containing All Three Characters](https://leetcode.com/problems/number-of-substrings-containing-all-three-characters/) | Two Pointers |
2461 | [Maximum Sum of Distinct Subarrays With Length K](https://leetcode.com/problems/maximum-sum-of-distinct-subarrays-with-length-k/) | [C++](./C++/maximum-sum-of-distinct-subarrays-with-length-k.cpp) [Python](./Python/maximum-sum-of-distinct-subarrays-with-length-k.py) | _O(n)_ | _O(k)_ | Medium | | Two Pointers |
2465 | [Number of Distinct Averages](https://leetcode.com/problems/number-of-distinct-averages/) | [C++](./C++/number-of-distinct-averages.cpp) [Python](./Python/number-of-distinct-averages.py) | _O(nlogn)_ | _O(n)_ | Easy | | Two Pointers, Hash Table |
2511 | [Maximum Enemy Forts That Can Be Captured](https://leetcode.com/problems/maximum-enemy-forts-that-can-be-captured/) | [C++](./C++/maximum-enemy-forts-that-can-be-captured.cpp) [Python](./Python/maximum-enemy-forts-that-can-be-captured.py) | _O(n)_ | _O(1)_ | Easy | | Array, Two Pointers |
2516 | [Take K of Each Character From Left and Right](https://leetcode.com/problems/take-k-of-each-character-from-left-and-right/) | [C++](./C++/take-k-of-each-character-from-left-and-right.cpp) [Python](./Python/take-k-of-each-character-from-left-and-right.py) | _O(n)_ | _O(1)_ | Medium | | Sliding Window, Two Pointers |
2524 | [Maximum Frequency Score of a Subarray](https://leetcode.com/problems/maximum-frequency-score-of-a-subarray/) | [C++](./C++/maximum-frequency-score-of-a-subarray.cpp) [Python](./Python/maximum-frequency-score-of-a-subarray.py) | _O(n)_ | _O(n)_ | Hard | š | Sliding Window, Two Pointers, Freq Table, Hash Table |
2537 | [Count the Number of Good Subarrays](https://leetcode.com/problems/count-the-number-of-good-subarrays/) | [C++](./C++/count-the-number-of-good-subarrays.cpp) [Python](./Python/count-the-number-of-good-subarrays.py) | _O(n)_ | _O(n)_ | Medium | | Sliding Window, Two Pointers |
2540 | [Minimum Common Value](https://leetcode.com/problems/minimum-common-value/) | [C++](./C++/minimum-common-value.cpp) [Python](./Python/minimum-common-value.py) | _O(n)_ | _O(1)_ | Easy | | Two Pointers |
2555 | [Maximize Win From Two Segments](https://leetcode.com/problems/maximize-win-from-two-segments/) | [C++](./C++/maximize-win-from-two-segments.cpp) [Python](./Python/maximize-win-from-two-segments.py) | _O(n)_ | _O(n)_ | Medium | | Two Pointers, Sliding Window, DP |
2563 | [Count the Number of Fair Pairs](https://leetcode.com/problems/count-the-number-of-fair-pairs/) | [C++](./C++/count-the-number-of-fair-pairs.cpp) [Python](./Python/count-the-number-of-fair-pairs.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Two Pointers
2570 | [Merge Two 2D Arrays by Summing Values](https://leetcode.com/problems/merge-two-2d-arrays-by-summing-values/) | [C++](./C++/merge-two-2d-arrays-by-summing-values.cpp) [Python](./Python/merge-two-2d-arrays-by-summing-values.py) | _O(n)_ | _O(1)_ | Easy | | Two Pointers
2609 | [Find the Longest Balanced Substring of a Binary String](https://leetcode.com/problems/find-the-longest-balanced-substring-of-a-binary-string/) | [C++](./C++/find-the-longest-balanced-substring-of-a-binary-string.cpp) [Python](./Python/find-the-longest-balanced-substring-of-a-binary-string.py) | _O(n)_ | _O(1)_ | Easy | | String, Two Pointers
2653 | [Sliding Subarray Beauty](https://leetcode.com/problems/sliding-subarray-beauty/) | [C++](./C++/sliding-subarray-beauty.cpp) [Python](./Python/sliding-subarray-beauty.py) | _O(nlogk)_ | _O(k)_ | Medium | | Sorted List, Ordered Set, Two Pointers
2730 | [Find the Longest Semi-Repetitive Substring](https://leetcode.com/problems/find-the-longest-semi-repetitive-substring/) | [C++](./C++/find-the-longest-semi-repetitive-substring.cpp) [Python](./Python/find-the-longest-semi-repetitive-substring.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers
2743 | [Count Substrings Without Repeating Character](https://leetcode.com/problems/count-substrings-without-repeating-character/) | [C++](./C++/count-substrings-without-repeating-character.cpp) [Python](./Python/count-substrings-without-repeating-character.py) | _O(n)_ | _O(1)_ | Medium | š, variant of [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | Two Pointers, Sliding Window
2747 | [Count Zero Request Servers](https://leetcode.com/problems/count-zero-request-servers/) | [C++](./C++/count-zero-request-servers.cpp) [Python](./Python/count-zero-request-servers.py) | _O(nlogn + mlogm)_ | _O(n + m)_ | Hard | | Sort, Two Pointers, Line Sweep
2762 | [Continuous Subarrays](https://leetcode.com/problems/continuous-subarrays/) | [C++](./C++/continuous-subarrays.cpp) [Python](./Python/continuous-subarrays.py) | _O(n)_ | _O(1)_ | Medium | | Mono Deque, BST, Ordered Dict, Two Pointers, Sliding Window
2763 | [Sum of Imbalance Numbers of All Subarrays](https://leetcode.com/problems/sum-of-imbalance-numbers-of-all-subarrays/) | [C++](./C++/sum-of-imbalance-numbers-of-all-subarrays.cpp) [Python](./Python/sum-of-imbalance-numbers-of-all-subarrays.py) | _O(n)_ | _O(n)_ | Hard | | Two Pointers, Sliding Window, Hash Table, Combinatorics
2779 | [Maximum Beauty of an Array After Applying Operation](https://leetcode.com/problems/maximum-beauty-of-an-array-after-applying-operation/) | [C++](./C++/maximum-beauty-of-an-array-after-applying-operation.cpp) [Python](./Python/maximum-beauty-of-an-array-after-applying-operation.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Two Pointers, Sliding Window
2781 | [Length of the Longest Valid Substring](https://leetcode.com/problems/length-of-the-longest-valid-substring/) | [C++](./C++/length-of-the-longest-valid-substring.cpp) [Python](./Python/length-of-the-longest-valid-substring.py) | _O((m + n) * l)_ | _O(t)_ | Hard | | Two Pointers, Sliding Window, Trie
2799 | [Count Complete Subarrays in an Array](https://leetcode.com/problems/count-complete-subarrays-in-an-array/) | [C++](./C++/count-complete-subarrays-in-an-array.cpp) [Python](./Python/count-complete-subarrays-in-an-array.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Two Pointers, Sliding Window
2824 | [Count Pairs Whose Sum is Less than Target](https://leetcode.com/problems/count-pairs-whose-sum-is-less-than-target/) | [C++](./C++/count-pairs-whose-sum-is-less-than-target.cpp) [Python](./Python/count-pairs-whose-sum-is-less-than-target.py) | _O(nlogn)_ | _O(1)_ | Easy | | Sort, Two Pointers
2831 | [Find the Longest Equal Subarray](https://leetcode.com/problems/find-the-longest-equal-subarray/) | [C++](./C++/find-the-longest-equal-subarray.cpp) [Python](./Python/find-the-longest-equal-subarray.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Two Pointers, Sliding Window
2838 | [Maximum Coins Heroes Can Collect](https://leetcode.com/problems/maximum-coins-heroes-can-collect/) | [C++](./C++/maximum-coins-heroes-can-collect.cpp) [Python](./Python/maximum-coins-heroes-can-collect.py) | _O(nlogn + mlogm)_ | _O(n + m)_ | Medium | š | Sort, Two Pointers
2841 | [Maximum Sum of Almost Unique Subarray](https://leetcode.com/problems/maximum-sum-of-almost-unique-subarray/) | [C++](./C++/maximum-sum-of-almost-unique-subarray.cpp) [Python](./Python/maximum-sum-of-almost-unique-subarray.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Two Pointers, Sliding Window
2875 | [Minimum Size Subarray in Infinite Array](https://leetcode.com/problems/minimum-size-subarray-in-infinite-array/) | [C++](./C++/minimum-size-subarray-in-infinite-array.cpp) [Python](./Python/minimum-size-subarray-in-infinite-array.py) | _O(n)_ | _O(1)_ | Medium | | Prefix Sum, Hash Table, Two Pointers, Sliding Window
2904 | [Shortest and Lexicographically Smallest Beautiful String](https://leetcode.com/problems/shortest-and-lexicographically-smallest-beautiful-string/) | [C++](./C++/shortest-and-lexicographically-smallest-beautiful-string.cpp) [Python](./Python/shortest-and-lexicographically-smallest-beautiful-string.py) | _O(n^2)_ | _O(1)_ | Medium | | Two Pointers, Sliding Window
2933 | [High-Access Employees](https://leetcode.com/problems/high-access-employees/) | [C++](./C++/high-access-employees.cpp) [Python](./Python/high-access-employees.py) | _O(nlogn)_ | _O(n)_ | Medium | | Sort, Two Pointers, Sliding Window
2938 | [Separate Black and White Balls](https://leetcode.com/problems/separate-black-and-white-balls/) | [C++](./C++/separate-black-and-white-balls.cpp) [Python](./Python/separate-black-and-white-balls.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers
2953 | [Count Complete Substrings](https://leetcode.com/problems/count-complete-substrings/) | [C++](./C++/count-complete-substrings.cpp) [Python](./Python/count-complete-substrings.py) | _O(26 + d * n)_ | _O(26)_ | Medium | | Freq Table, Two Pointers, Sliding Window
2958 | [Length of Longest Subarray With at Most K Frequency](https://leetcode.com/problems/length-of-longest-subarray-with-at-most-k-frequency/) | [C++](./C++/length-of-longest-subarray-with-at-most-k-frequency.cpp) [Python](./Python/length-of-longest-subarray-with-at-most-k-frequency.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Two Pointers, Sliding Window
2962 | [Count Subarrays Where Max Element Appears at Least K Times](https://leetcode.com/problems/count-subarrays-where-max-element-appears-at-least-k-times/) | [C++](./C++/count-subarrays-where-max-element-appears-at-least-k-times.cpp) [Python](./Python/count-subarrays-where-max-element-appears-at-least-k-times.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers, Sliding Window
2968 | [Apply Operations to Maximize Frequency Score](https://leetcode.com/problems/apply-operations-to-maximize-frequency-score/) | [C++](./C++/apply-operations-to-maximize-frequency-score.cpp) [Python](./Python/apply-operations-to-maximize-frequency-score.py) | _O(nlogn)_ | _O(1)_ | Hard | | Sort, Two Pointers, Sliding Window, Prefix Sum, Binary Search
2970 | [Count the Number of Incremovable Subarrays I](https://leetcode.com/problems/count-the-number-of-incremovable-subarrays-i/) | [C++](./C++/count-the-number-of-incremovable-subarrays-i.cpp) [Python](./Python/count-the-number-of-incremovable-subarrays-i.py) | _O(n)_ | _O(1)_ | Easy | | Two Pointers, Brute Force
2972 | [Count the Number of Incremovable Subarrays II](https://leetcode.com/problems/count-the-number-of-incremovable-subarrays-ii/) | [C++](./C++/count-the-number-of-incremovable-subarrays-ii.cpp) [Python](./Python/count-the-number-of-incremovable-subarrays-ii.py) | _O(n)_ | _O(1)_ | Hard | | Two Pointers
3006 | [Find Beautiful Indices in the Given Array I](https://leetcode.com/problems/find-beautiful-indices-in-the-given-array-i/) | [C++](./C++/find-beautiful-indices-in-the-given-array-i.cpp) [Python](./Python/find-beautiful-indices-in-the-given-array-i.py) | _O(n)_ | _O(min(a + b + x + y, n))_ | Medium | | `KMP Algorithm`, Binary Search, Two Pointers
3008 | [Find Beautiful Indices in the Given Array II](https://leetcode.com/problems/find-beautiful-indices-in-the-given-array-ii/) | [C++](./C++/find-beautiful-indices-in-the-given-array-ii.cpp) [Python](./Python/find-beautiful-indices-in-the-given-array-ii.py) | _O(n)_ | _O(min(a + b + x + y, n))_ | Hard | | `KMP Algorithm`, Binary Search, Two Pointers
3013 | [Divide an Array Into Subarrays With Minimum Cost II](https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-ii/) | [C++](./C++/divide-an-array-into-subarrays-with-minimum-cost-ii.cpp) [Python](./Python/divide-an-array-into-subarrays-with-minimum-cost-ii.py) | _O(nlogd)_ | _O(d)_ | Hard | | Sliding Window, Heap, Freq Table, Ordered Set, BST, Sorted List
3085 | [Minimum Deletions to Make String K-Special](https://leetcode.com/problems/minimum-deletions-to-make-string-k-special/) | [C++](./C++/minimum-deletions-to-make-string-k-special.cpp) [Python](./Python/minimum-deletions-to-make-string-k-special.py) | _O(n + 26)_ | _O(n + 26)_ | Medium | | Freq Table, Counting Sort, Two Pointers
3090 | [Maximum Length Substring With Two Occurrences](https://leetcode.com/problems/maximum-length-substring-with-two-occurrences/) | [C++](./C++/maximum-length-substring-with-two-occurrences.cpp) [Python](./Python/maximum-length-substring-with-two-occurrences.py) | _O(n + 26)_ | _O(26)_ | Easy | | Freq Table, Sliding Window, Two Pointers
3095 | [Shortest Subarray With OR at Least K I](https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-i/) | [C++](./C++/shortest-subarray-with-or-at-least-k-i.cpp) [Python](./Python/shortest-subarray-with-or-at-least-k-i.py) | _O(n * 30)_ | _O(30)_ | Easy | | Brute Force, Freq Table, Two Pointers
3097 | [Shortest Subarray With OR at Least K II](https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-ii/) | [C++](./C++/shortest-subarray-with-or-at-least-k-ii.cpp) [Python](./Python/shortest-subarray-with-or-at-least-k-ii.py) | _O(n * 30)_ | _O(30)_ | Medium | | Freq Table, Two Pointers
3171 | [Find Subarray With Bitwise OR Closest to K](https://leetcode.com/problems/find-subarray-with-bitwise-or-closest-to-k/)| [C++](./C++/find-subarray-with-bitwise-or-closest-to-k.cpp) [Python](./Python/find-subarray-with-bitwise-or-closest-to-k.py) | _O(nlogr)_ | _O(logr)_ | Hard | variant of [Find a Value of a Mysterious Function Closest to Target](https://leetcode.com/problems/find-a-value-of-a-mysterious-function-closest-to-target/) | DP, Freq Table, Two Pointers, Sliding Window
3206 | [Alternating Groups I](https://leetcode.com/problems/alternating-groups-i/)| [C++](./C++/alternating-groups-i.cpp) [Python](./Python/alternating-groups-i.py) | _O(n)_ | _O(1)_ | Easy | | Two Pointers, Sliding Window
3208 | [Alternating Groups II](https://leetcode.com/problems/alternating-groups-ii/)| [C++](./C++/alternating-groups-ii.cpp) [Python](./Python/alternating-groups-ii.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers, Sliding Window
3234 | [Count the Number of Substrings With Dominant Ones](https://leetcode.com/problems/count-the-number-of-substrings-with-dominant-ones/)| [C++](./C++/count-the-number-of-substrings-with-dominant-ones.cpp) [Python](./Python/count-the-number-of-substrings-with-dominant-ones.py) | _O(n^(3/2))_ | _O(1)_ | Medium | | Two Pointers, Sliding Window
3254 | [Find the Power of K-Size Subarrays I](https://leetcode.com/problems/find-the-power-of-k-size-subarrays-i/)| [C++](./C++/find-the-power-of-k-size-subarrays-i.cpp) [Python](./Python/find-the-power-of-k-size-subarrays-i.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers, Sliding Window
3255 | [Find the Power of K-Size Subarrays II](https://leetcode.com/problems/find-the-power-of-k-size-subarrays-ii/)| [C++](./C++/find-the-power-of-k-size-subarrays-ii.cpp) [Python](./Python/find-the-power-of-k-size-subarrays-ii.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers, Sliding Window
3258 | [Count Substrings That Satisfy K-Constraint I](https://leetcode.com/problems/count-substrings-that-satisfy-k-constraint-i/)| [C++](./C++/count-substrings-that-satisfy-k-constraint-i.cpp) [Python](./Python/count-substrings-that-satisfy-k-constraint-i.py) | _O(n)_ | _O(1)_ | Easy | | Two Pointers, Sliding Window
3261 | [Count Substrings That Satisfy K-Constraint II](https://leetcode.com/problems/count-substrings-that-satisfy-k-constraint-ii/)| [C++](./C++/count-substrings-that-satisfy-k-constraint-ii.cpp) [Python](./Python/count-substrings-that-satisfy-k-constraint-ii.py) | _O(n)_ | _O(n)_ | Hard | | Two Pointers, Sliding Window, Prefix Sum, Hash Table
3264 | [Final Array State After K Multiplication Operations I](https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-i/)| [C++](./C++/final-array-state-after-k-multiplication-operations-i.cpp) [Python](./Python/final-array-state-after-k-multiplication-operations-i.py) | _O(nlogn)_ | _O(n)_ | Easy | | Sort, Two Pointers, Sliding Window, Fast Exponentiation, Heap, Binary Search, Simulation
3266 | [Final Array State After K Multiplication Operations II](https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-ii/)| [C++](./C++/final-array-state-after-k-multiplication-operations-ii.cpp) [Python](./Python/final-array-state-after-k-multiplication-operations-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sort, Two Pointers, Sliding Window, Fast Exponentiation, Heap, Binary Search
3297 | [Count Substrings That Can Be Rearranged to Contain a String I](https://leetcode.com/problems/count-substrings-that-can-be-rearranged-to-contain-a-string-i/)| [C++](./C++/count-substrings-that-can-be-rearranged-to-contain-a-string-i.cpp) [Python](./Python/count-substrings-that-can-be-rearranged-to-contain-a-string-i.py) | _O(n + 26)_ | _O(26)_ | Medium | | Two Pointers, Sliding Window, Freq Table
3298 | [Count Substrings That Can Be Rearranged to Contain a String II](https://leetcode.com/problems/count-substrings-that-can-be-rearranged-to-contain-a-string-ii/)| [C++](./C++/count-substrings-that-can-be-rearranged-to-contain-a-string-ii.cpp) [Python](./Python/count-substrings-that-can-be-rearranged-to-contain-a-string-ii.py) | _O(n + 26)_ | _O(26)_ | Hard | | Two Pointers, Sliding Window, Freq Table
3305 | [Count of Substrings Containing Every Vowel and K Consonants I](https://leetcode.com/problems/count-of-substrings-containing-every-vowel-and-k-consonants-i/)| [C++](./C++/count-of-substrings-containing-every-vowel-and-k-consonants-i.cpp) [Python](./Python/count-of-substrings-containing-every-vowel-and-k-consonants-i.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers, Sliding Window, Freq Table
3306 | [Count of Substrings Containing Every Vowel and K Consonants II](https://leetcode.com/problems/count-of-substrings-containing-every-vowel-and-k-consonants-ii/)| [C++](./C++/count-of-substrings-containing-every-vowel-and-k-consonants-ii.cpp) [Python](./Python/count-of-substrings-containing-every-vowel-and-k-consonants-ii.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers, Sliding Window, Freq Table
3318 | [Find X-Sum of All K-Long Subarrays I](https://leetcode.com/problems/find-x-sum-of-all-k-long-subarrays-i/)| [C++](./C++/find-x-sum-of-all-k-long-subarrays-i.cpp) [Python](./Python/find-x-sum-of-all-k-long-subarrays-i.py) | _O(nlogn)_ | _O(n)_ | Easy | | Two Pointers, Sliding Window, Freq Table, Ordered Set, Sorted List
3321 | [Find X-Sum of All K-Long Subarrays II](https://leetcode.com/problems/find-x-sum-of-all-k-long-subarrays-ii/)| [C++](./C++/find-x-sum-of-all-k-long-subarrays-ii.cpp) [Python](./Python/find-x-sum-of-all-k-long-subarrays-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | | Two Pointers, Sliding Window, Freq Table, Ordered Set, Sorted List
3323 | [Minimize Connected Groups by Inserting Interval](https://leetcode.com/problems/minimize-connected-groups-by-inserting-interval/) | [C++](./C++/minimize-connected-groups-by-inserting-interval.cpp) [Python](./Python/minimize-connected-groups-by-inserting-interval.py) | _O(nlogn)_ | _O(n)_ | Medium | š | Sort, Prefix Sum, Two Pointers, Sliding Window
3325 | [Count Substrings With K-Frequency Characters I](https://leetcode.com/problems/count-substrings-with-k-frequency-characters-i/) | [C++](./C++/count-substrings-with-k-frequency-characters-i.cpp) [Python](./Python/count-substrings-with-k-frequency-characters-i.py) | _O(n + 26)_ | _O(26)_ | Medium | | Freq Table, Two Pointers, Sliding Window
3329 | [Count Substrings With K-Frequency Characters II](https://leetcode.com/problems/count-substrings-with-k-frequency-characters-ii/) | [C++](./C++/count-substrings-with-k-frequency-characters-ii.cpp) [Python](./Python/count-substrings-with-k-frequency-characters-ii.py) | _O(n + 26)_ | _O(26)_ | Hard | š | Freq Table, Two Pointers, Sliding Window
3346 | [Maximum Frequency of an Element After Performing Operations I](https://leetcode.com/problems/maximum-frequency-of-an-element-after-performing-operations-i/) | [C++](./C++/maximum-frequency-of-an-element-after-performing-operations-i.cpp) [Python](./Python/maximum-frequency-of-an-element-after-performing-operations-i.py) | _O(nlogn)_ | _O(n)_ | Medium | | Sort, Freq Table, Two Pointers, Sliding Window, Difference Array, Line Sweep
3347 | [Maximum Frequency of an Element After Performing Operations II](https://leetcode.com/problems/maximum-frequency-of-an-element-after-performing-operations-ii/) | [C++](./C++/maximum-frequency-of-an-element-after-performing-operations-ii.cpp) [Python](./Python/maximum-frequency-of-an-element-after-performing-operations-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sort, Freq Table, Two Pointers, Sliding Window, Difference Array, Line Sweep
3364 | [Minimum Positive Sum Subarray](https://leetcode.com/problems/minimum-positive-sum-subarray/) | [C++](./C++/minimum-positive-sum-subarray.cpp) [Python](./Python/minimum-positive-sum-subarray.py) | _O(nlogn)_ | _O(n)_ | Easy | | Prefix Sum, Two Pointers, Sliding Window, Sorted List, BST, Binary Search
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Recursion
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2613 | [Beautiful Pairs](https://leetcode.com/problems/beautiful-pairs/) | [C++](./C++/beautiful-pairs.cpp) [Python](./Python/beautiful-pairs.py) | _O(n)_ on average | _O(n)_ | Hard | š, variant of [SPOJ - Closest Point Pair](https://www.spoj.com/problems/CLOPPAIR/) | Random Algorithms, Divide and Conquer, Merge Sort, Segment Tree |
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Binary Search
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2064 | [Minimized Maximum of Products Distributed to Any Store](https://leetcode.com/problems/minimized-maximum-of-products-distributed-to-any-store/) | [C++](./C++/minimized-maximum-of-products-distributed-to-any-store.cpp) [Python](./Python/minimized-maximum-of-products-distributed-to-any-store.py) | _O(nlogm)_ | _O(1)_ | Medium | variant of [Minimum Limit of Balls in a Bag](https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag/) |
2111 | [Minimum Operations to Make the Array K-Increasing](https://leetcode.com/problems/minimum-operations-to-make-the-array-k-increasing/) | [C++](./C++/minimum-operations-to-make-the-array-k-increasing.cpp) [Python](./Python/minimum-operations-to-make-the-array-k-increasing.py) | _O(nlog(n/k))_ | _O(n/k)_ | Hard | variant of [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) |
2137 | [Pour Water Between Buckets to Make Water Levels Equal](https://leetcode.com/problems/pour-water-between-buckets-to-make-water-levels-equal/) | [C++](./C++/pour-water-between-buckets-to-make-water-levels-equal.cpp) [Python](./Python/pour-water-between-buckets-to-make-water-levels-equal.py) | _O(nlogr)_ | _O(1)_ | Medium | š |
2187 | [Minimum Time to Complete Trips](https://leetcode.com/problems/minimum-time-to-complete-trips/) | [C++](./C++/minimum-time-to-complete-trips.cpp) [Python](./Python/minimum-time-to-complete-trips.py) | _O(nlogr)_ | _O(1)_ | Medium | |
2226 | [Maximum Candies Allocated to K Children](https://leetcode.com/problems/maximum-candies-allocated-to-k-children/) | [C++](./C++/maximum-candies-allocated-to-k-children.cpp) [Python](./Python/maximum-candies-allocated-to-k-children.py) | _O(nlogr)_ | _O(1)_ | Medium | | Binary Search
2250 | [Count Number of Rectangles Containing Each Point](https://leetcode.com/problems/count-number-of-rectangles-containing-each-point/) | [C++](./C++/count-number-of-rectangles-containing-each-point.cpp) [Python](./Python/count-number-of-rectangles-containing-each-point.py) | _O(nlogn + m * max_y * logn)_ | _O(n)_ | Medium | | Bucket Sort, Binary Search
2300 | [Successful Pairs of Spells and Potions](https://leetcode.com/problems/successful-pairs-of-spells-and-potions/) | [C++](./C++/successful-pairs-of-spells-and-potions.cpp) [Python](./Python/successful-pairs-of-spells-and-potions.py) | _O(mlogm + nlogm)_ | _O(1)_ | Medium | | Binary Search
2333 | [Minimum Sum of Squared Difference](https://leetcode.com/problems/minimum-sum-of-squared-difference/) | [C++](./C++/minimum-sum-of-squared-difference.cpp) [Python](./Python/minimum-sum-of-squared-difference.py) | _O(nlogn + nlogr)_ | _O(1)_ | Medium | | Binary Search
2387 | [Median of a Row Wise Sorted Matrix](https://leetcode.com/problems/median-of-a-row-wise-sorted-matrix/) | [C++](./C++/median-of-a-row-wise-sorted-matrix.cpp) [Python](./Python/median-of-a-row-wise-sorted-matrix.py) | _O(logr * mlogn)_ | _O(1)_ | Medium | š | Binary Search |
2389 | [Longest Subsequence With Limited Sum](https://leetcode.com/problems/longest-subsequence-with-limited-sum/) | [C++](./C++/longest-subsequence-with-limited-sum.cpp) [Python](./Python/longest-subsequence-with-limited-sum.py) | _O(nlogn + qlogn)_ | _O(1)_ | Easy | | Greedy, Sort, Binary Search |
2448 | [Minimum Cost to Make Array Equal](https://leetcode.com/problems/minimum-cost-to-make-array-equal/) | [C++](./C++/minimum-cost-to-make-array-equal.cpp) [Python](./Python/minimum-cost-to-make-array-equal.py) | _O(nlogn)_ | _O(n)_ | Hard | | Math, Binary Search, Prefix Sum |
2476 | [Closest Nodes Queries in a Binary Search Tree](https://leetcode.com/problems/closest-nodes-queries-in-a-binary-search-tree/) | [C++](./C++/closest-nodes-queries-in-a-binary-search-tree.cpp) [Python](./Python/closest-nodes-queries-in-a-binary-search-tree.py) | _O(n + qlogn)_ | _O(n)_ | Hard | | DFS, Binary Search |
2513 | [Minimize the Maximum of Two Arrays](https://leetcode.com/problems/minimize-the-maximum-of-two-arrays/) | [C++](./C++/minimize-the-maximum-of-two-arrays.cpp) [Python](./Python/minimize-the-maximum-of-two-arrays.py) | _O(log(min(d1, d2)))_ | _O(1)_ | Medium | | Number Theory, Binary Search |
2517 | [Maximum Tastiness of Candy Basket](https://leetcode.com/problems/maximum-tastiness-of-candy-basket/) | [C++](./C++/maximum-tastiness-of-candy-basket.cpp) [Python](./Python/maximum-tastiness-of-candy-basket.py) | _O(nlogr)_ | _O(1)_ | Medium | | Binary Search, Greedy |
2528 | [Maximize the Minimum Powered City](https://leetcode.com/problems/maximize-the-minimum-powered-city/) | [C++](./C++/maximize-the-minimum-powered-city.cpp) [Python](./Python/maximize-the-minimum-powered-city.py) | _O(nlogk)_ | _O(n)_ | Hard | | Binary Search, Sliding Window, Greedy |
2529 | [Maximum Count of Positive Integer and Negative Integer](https://leetcode.com/problems/maximum-count-of-positive-integer-and-negative-integer/) | [C++](./C++/maximum-count-of-positive-integer-and-negative-integer.cpp) [Python](./Python/maximum-count-of-positive-integer-and-negative-integer.py) | _O(logn)_ | _O(1)_ | Easy | | Binary Search |
2554 | [Maximum Number of Integers to Choose From a Range I](https://leetcode.com/problems/maximum-number-of-integers-to-choose-from-a-range-i/) | [C++](./C++/maximum-number-of-integers-to-choose-from-a-range-i.cpp) [Python](./Python/maximum-number-of-integers-to-choose-from-a-range-i.py) | _O(b)_ | _O(b)_ | Medium | | Math, Binary Search, Prefix Sum, Greedy |
2557 | [Maximum Number of Integers to Choose From a Range II](https://leetcode.com/problems/maximum-number-of-integers-to-choose-from-a-range-ii/) | [C++](./C++/maximum-number-of-integers-to-choose-from-a-range-ii.cpp) [Python](./Python/maximum-number-of-integers-to-choose-from-a-range-ii.py) | _O(b)_ | _O(b)_ | Medium | š | Math, Binary Search, Prefix Sum |
2560 | [House Robber IV](https://leetcode.com/problems/house-robber-iv/) | [C++](./C++/house-robber-iv.cpp) [Python](./Python/house-robber-iv.py) | _O(nlogn)_ | _O(n)_ | Medium | | Binary Search, Greedy |
2594 | [Minimum Time to Repair Cars](https://leetcode.com/problems/minimum-time-to-repair-cars/) | [C++](./C++/minimum-time-to-repair-cars.cpp) [Python](./Python/minimum-time-to-repair-cars.py) | _O(mx * (logc + log(mn)))_ | _O(mx)_ | Medium | | Freq Table, Binary Search, Heap, Simulation |
2602 | [Minimum Operations to Make All Array Elements Equal](https://leetcode.com/problems/minimum-operations-to-make-all-array-elements-equal/) | [C++](./C++/minimum-operations-to-make-all-array-elements-equal.cpp) [Python](./Python/minimum-operations-to-make-all-array-elements-equal.py) | _O(nlogn + qlogn)_ | _O(n)_ | Medium | | Sort, Binary Search, Prefix Sum |
2616 | [Minimize the Maximum Difference of Pairs](https://leetcode.com/problems/minimize-the-maximum-difference-of-pairs/) | [C++](./C++/minimize-the-maximum-difference-of-pairs.cpp) [Python](./Python/minimize-the-maximum-difference-of-pairs.py) | _O(nlogn + nlogr)_ | _O(1)_ | Medium | | Sort, Binary Search, Greedy |
2702 | [Minimum Operations to Make Numbers Non-positive](https://leetcode.com/problems/minimum-operations-to-make-numbers-non-positive/) | [C++](./C++/minimum-operations-to-make-numbers-non-positive.cpp) [Python](./Python/minimum-operations-to-make-numbers-non-positive.py) | _O(nlogr)_ | _O(1)_ | Hard | š | Binary Search, Greedy |
2936 | [Number of Equal Numbers Blocks](https://leetcode.com/problems/number-of-equal-numbers-blocks/) | [C++](./C++/number-of-equal-numbers-blocks.cpp) [Python](./Python/number-of-equal-numbers-blocks.py) | _O(klogn)_ | _O(1)_ | Medium | š | Binary Search |
2940 | [Find Building Where Alice and Bob Can Meet](https://leetcode.com/problems/find-building-where-alice-and-bob-can-meet/) | [C++](./C++/find-building-where-alice-and-bob-can-meet.cpp) [Python](./Python/find-building-where-alice-and-bob-can-meet.py) | _O(n + qlogn)_ | _O(n)_ | Hard | | Heap, Mono Stack, Binary Search, Online Solution, Segment Tree |
3048 | [Earliest Second to Mark Indices I](https://leetcode.com/problems/earliest-second-to-mark-indices-i/) | [C++](./C++/earliest-second-to-mark-indices-i.cpp) [Python](./Python/earliest-second-to-mark-indices-i.py) | _O(mlogm)_ | _O(n)_ | Medium | | Binary Search, Greedy |
3049 | [Earliest Second to Mark Indices II](https://leetcode.com/problems/earliest-second-to-mark-indices-ii/) | [C++](./C++/earliest-second-to-mark-indices-ii.cpp) [Python](./Python/earliest-second-to-mark-indices-ii.py) | _O((m + nlogn) *logm)_ | _O(n)_ | Hard | | Binary Search, Greedy, Heap |
3104 | [Find Longest Self-Contained Substring](https://leetcode.com/problems/find-longest-self-contained-substring/) | [C++](./C++/find-longest-self-contained-substring.cpp) [Python](./Python/find-longest-self-contained-substring.py) | _O(n + 26^3 * logn)_ | _O(n)_ | Hard | š | Brute Force, Freq Table, Two Pointers, Hash Table, Binary Search |
3116 | [Kth Smallest Amount With Single Denomination Combination](https://leetcode.com/problems/kth-smallest-amount-with-single-denomination-combination/) | [C++](./C++/kth-smallest-amount-with-single-denomination-combination.cpp) [Python](./Python/kth-smallest-amount-with-single-denomination-combination.py) | _O(n * 2^n * logk)_ | _O(2^n)_ | Hard | | Binary Search, Principle of Inclusion and Exclusion, Number Theory |
3134 | [Find the Median of the Uniqueness Array](https://leetcode.com/problems/find-the-median-of-the-uniqueness-array/) | [C++](./C++/find-the-median-of-the-uniqueness-array.cpp) [Python](./Python/find-the-median-of-the-uniqueness-array.py) | _O(nlogn)_ | _O(n)_ | Hard | | Binary Search, Two Pointers, Sliding Window |
3135 | [Equalize Strings by Adding or Removing Characters at Ends](https://leetcode.com/problems/equalize-strings-by-adding-or-removing-characters-at-ends/) | [C++](./C++/equalize-strings-by-adding-or-removing-characters-at-ends.cpp) [Python](./Python/equalize-strings-by-adding-or-removing-characters-at-ends.py) | _O((n + m) * log(min(n, m)))_ | _O(min(n, m))_ | Medium | š | Binary Search, `Rabin-Karp Algorithm`, Rolling Hash, DP
3145 | [Find Products of Elements of Big Array](https://leetcode.com/problems/find-products-of-elements-of-big-array/) | [C++](./C++/find-products-of-elements-of-big-array.cpp) [Python](./Python/find-products-of-elements-of-big-array.py) | _O(q * (logr)^2)_ | _O(1)_ | Hard | | Binary Search, Combinatorics, Bitmasks, Fast Exponentiation
3231 | [Minimum Number of Increasing Subsequence to Be Removed](https://leetcode.com/problems/minimum-number-of-increasing-subsequence-to-be-removed/) | [C++](./C++/minimum-number-of-increasing-subsequence-to-be-removed.cpp) [Python](./Python/minimum-number-of-increasing-subsequence-to-be-removed.py) | _O(nlogn)_ | _O(n)_ | Hard | š, variant of [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | Binary Search
3233 | [Find the Count of Numbers Which Are Not Special](https://leetcode.com/problems/find-the-count-of-numbers-which-are-not-special/) | [C++](./C++/find-the-count-of-numbers-which-are-not-special.cpp) [Python](./Python/find-the-count-of-numbers-which-are-not-special.py) | precompute: _O(sqrt(r))_<br>runtime: _O(logr)_ | _O(sqrt(r))_ | Medium | | Number Theory, `Linear Sieve of Eratosthenes`, Binary Search |
3281 | [Maximize Score of Numbers in Ranges](https://leetcode.com/problems/maximize-score-of-numbers-in-ranges/) | [C++](./C++/maximize-score-of-numbers-in-ranges.cpp) [Python](./Python/maximize-score-of-numbers-in-ranges.py) | _O(nlogr)_ | _O(1)_ | Medium | | Binary Search, Greedy
3288 | [Length of the Longest Increasing Path](https://leetcode.com/problems/length-of-the-longest-increasing-path/) | [C++](./C++/length-of-the-longest-increasing-path.cpp) [Python](./Python/length-of-the-longest-increasing-path.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sort, Binary Search, Longest Increasing Subsequence
3296 | [Minimum Number of Seconds to Make Mountain Height Zero](https://leetcode.com/problems/minimum-number-of-seconds-to-make-mountain-height-zero/) | [C++](./C++/minimum-number-of-seconds-to-make-mountain-height-zero.cpp) [Python](./Python/minimum-number-of-seconds-to-make-mountain-height-zero.py) | _O(nlogr)_ | _O(1)_ | Medium | | Binary Search, Quadratic Equation, Heap
3356 | [Zero Array Transformation II](https://leetcode.com/problems/zero-array-transformation-ii/) | [C++](./C++/zero-array-transformation-ii.cpp) [Python](./Python/zero-array-transformation-ii.py) | _O((n + q) * logn)_ | _O(n)_ | Medium | | Binary Search, Line Sweep
3357 | [Minimize the Maximum Adjacent Element Difference](https://leetcode.com/problems/minimize-the-maximum-adjacent-element-difference/) | [C++](./C++/minimize-the-maximum-adjacent-element-difference.cpp) [Python](./Python/minimize-the-maximum-adjacent-element-difference.py) | _O(nlogr)_ | _O(1)_ | Hard | | Binary Search
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Binary Search Tree
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2426 | [Number of Pairs Satisfying Inequality](https://leetcode.com/problems/number-of-pairs-satisfying-inequality/)|[C++](./C++/number-of-pairs-satisfying-inequality.cpp) [Python](./Python/number-of-pairs-satisfying-inequality.py) | _O(nlogn)_ | _O(n)_ | Hard | | Merge Sort, Two Pointers, BIT, Fenwick Tree, Coordinate Compression, Sorted List, Ordered Set, Binary Search
2689 | [Extract Kth Character From The Rope Tree](https://leetcode.com/problems/extract-kth-character-from-the-rope-tree/)|[C++](./C++/extract-kth-character-from-the-rope-tree.cpp) [Python](./Python/extract-kth-character-from-the-rope-tree.py) | _O(h)_ | _O(1)_ | Medium | š | BST
2817 | [Minimum Absolute Difference Between Elements With Constraint](https://leetcode.com/problems/minimum-absolute-difference-between-elements-with-constraint/) | [C++](./C++/minimum-absolute-difference-between-elements-with-constraint.cpp) [Python](./Python/minimum-absolute-difference-between-elements-with-constraint.py) | _O(nlogn)_ | _O(n)_ | Medium | | Sorted List, BST, Binary Search |
2907 | [Maximum Profitable Triplets With Increasing Prices I](https://leetcode.com/problems/maximum-profitable-triplets-with-increasing-prices-i/) | [C++](./C++/maximum-profitable-triplets-with-increasing-prices-i.cpp) [Python](./Python/maximum-profitable-triplets-with-increasing-prices-i.py) | _O(nlogn)_ | _O(n)_ | Medium | š | Prefix Sum, Sorted List, BST, Binary Search, Mono Stack, BIT, Fenwick Tree, Segment Tree |
2921 | [Maximum Profitable Triplets With Increasing Prices II](https://leetcode.com/problems/maximum-profitable-triplets-with-increasing-prices-ii/) | [C++](./C++/maximum-profitable-triplets-with-increasing-prices-ii.cpp) [Python](./Python/maximum-profitable-triplets-with-increasing-prices-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | š | Prefix Sum, Sorted List, BST, Binary Search, Mono Stack, BIT, Fenwick Tree, Segment Tree |
2926 | [Maximum Balanced Subsequence Sum](https://leetcode.com/problems/maximum-balanced-subsequence-sum/) | [C++](./C++/maximum-balanced-subsequence-sum.cpp) [Python](./Python/maximum-balanced-subsequence-sum.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sorted List, BST, Binary Search, Mono Stack, BIT, Fenwick Tree, Segment Tree |
3072 | [Distribute Elements Into Two Arrays II](https://leetcode.com/problems/distribute-elements-into-two-arrays-ii/) | [C++](./C++/distribute-elements-into-two-arrays-ii.cpp) [Python](./Python/distribute-elements-into-two-arrays-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sorted List, Ordered Set
3073 | [Maximum Increasing Triplet Value](https://leetcode.com/problems/maximum-increasing-triplet-value/) | [C++](./C++/maximum-increasing-triplet-value.cpp) [Python](./Python/maximum-increasing-triplet-value.py) | _O(nlogn)_ | _O(n)_ | Medium | š | Sorted List, BST, Prefix Sum
3161 | [Block Placement Queries](https://leetcode.com/problems/block-placement-queries/) | [C++](./C++/block-placement-queries.cpp) [Python](./Python/block-placement-queries.py) | _O(qlogq)_ | _O(q)_ | Hard | | Sorted List, BST, BIT, Fenwick Tree, Segment Tree
3165 | [Maximum Sum of Subsequence With Non-adjacent Elements](https://leetcode.com/problems/maximum-sum-of-subsequence-with-non-adjacent-elements/) | [C++](./C++/maximum-sum-of-subsequence-with-non-adjacent-elements.cpp) [Python](./Python/maximum-sum-of-subsequence-with-non-adjacent-elements.py) | _O(n + qlogn)_ | _O(n)_ | Hard | | Segment Tree
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Breadth-First Search
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2039 | [The Time When the Network Becomes Idle](https://leetcode.com/problems/the-time-when-the-network-becomes-idle/)| [C++](./C++/the-time-when-the-network-becomes-idle.cpp) [Python](./Python/the-time-when-the-network-becomes-idle.py)| _O(\|E\|)_ | _O(\|E\|)_ | Medium | | Math |
2045 | [Second Minimum Time to Reach Destination](https://leetcode.com/problems/second-minimum-time-to-reach-destination/)| [C++](./C++/second-minimum-time-to-reach-destination.cpp) [Python](./Python/second-minimum-time-to-reach-destination.py)| _O(\|E\|)_ | _O(\|E\|)_ | Hard | | Bi-BFS |
2050 | [Parallel Courses III](https://leetcode.com/problems/parallel-courses-iii/)| [C++](./C++/parallel-courses-iii.cpp) [Python](./Python/parallel-courses-iii.py) | _O(\|V\| + \|E\|)_ | _O(\|E\|)_ | Hard | variant of [Parallel Courses](https://leetcode.com/problems/parallel-courses/) | Topological Sort |
2059 | [Minimum Operations to Convert Number](https://leetcode.com/problems/minimum-operations-to-convert-number/)| [C++](./C++/minimum-operations-to-convert-number.cpp) [Python](./Python/minimum-operations-to-convert-number.py)| _O(m * n)_ | _O(m)_ | Medium | | |
2115 | [Find All Possible Recipes from Given Supplies](https://leetcode.com/problems/find-all-possible-recipes-from-given-supplies/)| [C++](./C++/find-all-possible-recipes-from-given-supplies.cpp) [Python](./Python/find-all-possible-recipes-from-given-supplies.py) | _O(\|E\|)_ | _O(\|E\|)_ | Medium | | Topological Sort |
2146 | [K Highest Ranked Items Within a Price Range](https://leetcode.com/problems/k-highest-ranked-items-within-a-price-range/)| [C++](./C++/k-highest-ranked-items-within-a-price-range.cpp) [Python](./Python/k-highest-ranked-items-within-a-price-range.py) | _O(m * n + klogk)_ | _O(m * n)_ | Medium | | BFS, Quick Select, Sort |
2258 | [Escape the Spreading Fire](https://leetcode.com/problems/escape-the-spreading-fire/)| [C++](./C++/escape-the-spreading-fire.cpp) [Python](./Python/escape-the-spreading-fire.py) | _O(m * n)_ | _O(m * n)_ | Hard | | BFS |
2290 | [Minimum Obstacle Removal to Reach Corner](https://leetcode.com/problems/minimum-obstacle-removal-to-reach-corner/)| [C++](./C++/minimum-obstacle-removal-to-reach-corner.cpp) [Python](./Python/minimum-obstacle-removal-to-reach-corner.py)| _O(m * n)_ | _O(m * n)_ | Hard | variant of [Minimum Cost to Make at Least One Valid Path in a Grid](https://leetcode.com/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid/) | `A* Search Algorithm`, 0-1 BFS, Deque |
2316 | [Count Unreachable Pairs of Nodes in an Undirected Graph](https://leetcode.com/problems/count-unreachable-pairs-of-nodes-in-an-undirected-graph/)| [C++](./C++/count-unreachable-pairs-of-nodes-in-an-undirected-graph.cpp) [Python](./Python/count-unreachable-pairs-of-nodes-in-an-undirected-graph.py)| _O(n)_ | _O(n)_ | Medium | | Flood Fill, BFS, Math |
2368 | [Reachable Nodes With Restrictions](https://leetcode.com/problems/reachable-nodes-with-restrictions/)| [C++](./C++/reachable-nodes-with-restrictions.cpp) [Python](./Python/reachable-nodes-with-restrictions.py)| _O(n)_ | _O(n)_ | Medium | | BFS |
2415 | [Reverse Odd Levels of Binary Tree](https://leetcode.com/problems/reverse-odd-levels-of-binary-tree/)| [C++](./C++/reverse-odd-levels-of-binary-tree.cpp) [Python](./Python/reverse-odd-levels-of-binary-tree.py)| _O(n)_ | _O(n)_ | Medium | | BFS |
2471 | [Minimum Number of Operations to Sort a Binary Tree by Level](https://leetcode.com/problems/minimum-number-of-operations-to-sort-a-binary-tree-by-level/)| [C++](./C++/minimum-number-of-operations-to-sort-a-binary-tree-by-level.cpp) [Python](./Python/minimum-number-of-operations-to-sort-a-binary-tree-by-level.py)| _O(nlogn)_ | _O(w)_ | Medium | | Sort, BFS |
2492 | [Minimum Score of a Path Between Two Cities](https://leetcode.com/problems/minimum-score-of-a-path-between-two-cities/)| [C++](./C++/minimum-score-of-a-path-between-two-cities.cpp) [Python](./Python/minimum-score-of-a-path-between-two-cities.py)| _O(n + m)_ | _O(n + m)_ | Medium | | BFS |
2493 | [Divide Nodes Into the Maximum Number of Groups](https://leetcode.com/problems/divide-nodes-into-the-maximum-number-of-groups/)| [C++](./C++/divide-nodes-into-the-maximum-number-of-groups.cpp) [Python](./Python/divide-nodes-into-the-maximum-number-of-groups.py)| _O(n^2)_ | _O(n)_ | Medium | variant of [Is Graph Bipartite?](https://leetcode.com/problems/is-graph-bipartite/) | BFS, DFS |
2503 | [Maximum Number of Points From Grid Queries](https://leetcode.com/problems/maximum-number-of-points-from-grid-queries/)| [C++](./C++/maximum-number-of-points-from-grid-queries.cpp) [Python](./Python/maximum-number-of-points-from-grid-queries.py)| _O((m * n + q) * log(m * n))_ | _O(m * n)_ | Hard || BFS, Heap, Prefix Sum, Binary Search |
2577 | [Minimum Time to Visit a Cell In a Grid](https://leetcode.com/problems/minimum-time-to-visit-a-cell-in-a-grid/)| [C++](./C++/minimum-time-to-visit-a-cell-in-a-grid.cpp) [Python](./Python/minimum-time-to-visit-a-cell-in-a-grid.py)| _O(m * n * log\(m * n\))_ | _O(m * n)_ | Hard | | `Dijkstra's Algorithm` |
2583 | [Kth Largest Sum in a Binary Tree](https://leetcode.com/problems/kth-largest-sum-in-a-binary-tree/)| [C++](./C++/kth-largest-sum-in-a-binary-tree.cpp) [Python](./Python/kth-largest-sum-in-a-binary-tree.py)| _O(n)_ | _O(n)_ | Medium | | BFS, Quick Select |
2603 | [Collect Coins in a Tree](https://leetcode.com/problems/collect-coins-in-a-tree/) | [C++](./C++/collect-coins-in-a-tree.cpp) [Python](./Python/collect-coins-in-a-tree.py) | _O(n)_ | _O(n)_| Hard || Tree, BFS |
2612 | [Minimum Reverse Operations](https://leetcode.com/problems/minimum-reverse-operations/) | [C++](./C++/minimum-reverse-operations.cpp) [Python](./Python/minimum-reverse-operations.py) | _O(n)_ | _O(n)_| Hard || BFS, Union Find, BST, Sorted List |
2617 | [Minimum Number of Visited Cells in a Grid](https://leetcode.com/problems/minimum-number-of-visited-cells-in-a-grid/) | [C++](./C++/minimum-number-of-visited-cells-in-a-grid.cpp) [Python](./Python/minimum-number-of-visited-cells-in-a-grid.py) | _O(m * n)_ | _O(m * n)_| Hard | variant of [Minimum Reverse Operations](https://leetcode.com/problems/minimum-reverse-operations/) | BFS, Union Find, BST, Sorted List |
2641 | [Cousins in Binary Tree II](https://leetcode.com/problems/cousins-in-binary-tree-ii/) | [C++](./C++/cousins-in-binary-tree-ii.cpp) [Python](./Python/cousins-in-binary-tree-ii.py) | _O(n)_ | _O(w)_| Medium || BFS |
2658 | [Maximum Number of Fish in a Grid](https://leetcode.com/problems/maximum-number-of-fish-in-a-grid/) | [C++](./C++/maximum-number-of-fish-in-a-grid.cpp) [Python](./Python/maximum-number-of-fish-in-a-grid.py) | _O(m * n)_ | _O(m + n)_| Medium || BFS, DFS |
2685 | [Count the Number of Complete Components](https://leetcode.com/problems/count-the-number-of-complete-components/) | [C++](./C++/count-the-number-of-complete-components.cpp) [Python](./Python/count-the-number-of-complete-components.py) | _O(n)_ | _O(n)_| Medium || BFS |
2709 | [Greatest Common Divisor Traversal](https://leetcode.com/problems/greatest-common-divisor-traversal/) | [C++](./C++/greatest-common-divisor-traversal.cpp) [Python](./Python/greatest-common-divisor-traversal.py) | precompute: _O(sqrt(r))_<br>runtime: _O(n * (logr + sqrt(r)/log(sqrt(r))))_ | _O(sqrt(r) + nlogr)_| Hard || `Linear Sieve of Eratosthenes`, Factorization, BFS |
2812 | [Find the Safest Path in a Grid](https://leetcode.com/problems/find-the-safest-path-in-a-grid/) | [C++](./C++/find-the-safest-path-in-a-grid.cpp) [Python](./Python/find-the-safest-path-in-a-grid.py) | _O(n^2)_ | _O(n^2)_| Medium || BFS, Bucket Sort, Union Find, `Dijkstra's Algorithm`, Binary Search |
2814 | [Minimum Time Takes to Reach Destination Without Drowning](https://leetcode.com/problems/minimum-time-takes-to-reach-destination-without-drowning/) | [C++](./C++/minimum-time-takes-to-reach-destination-without-drowning.cpp) [Python](./Python/minimum-time-takes-to-reach-destination-without-drowning.py) | _O(m * n)_ | _O(m * n)_| Hard | š | Simulation, BFS |
2852 | [Sum of Remoteness of All Cells](https://leetcode.com/problems/sum-of-remoteness-of-all-cells/)| [C++](./C++/sum-of-remoteness-of-all-cells.cpp) [Python](./Python/sum-of-remoteness-of-all-cells.py)| _O(n^2)_ | _O(n^2)_ | Medium | š | Flood Fill, BFS, Math |
3157 | [Find the Level of Tree with Minimum Sum](https://leetcode.com/problems/find-the-level-of-tree-with-minimum-sum/)| [C++](./C++/find-the-level-of-tree-with-minimum-sum.cpp) [Python](./Python/find-the-level-of-tree-with-minimum-sum.py)| _O(n)_ | _O(w)_ | Medium | š | BFS |
3286 | [Find a Safe Walk Through a Grid](https://leetcode.com/problems/find-a-safe-walk-through-a-grid/)| [C++](./C++/find-a-safe-walk-through-a-grid.cpp) [Python](./Python/find-a-safe-walk-through-a-grid.py)| _O(m * n)_ | _O(m * n)_ | Medium | variant of [Minimum Obstacle Removal to Reach Corner](https://leetcode.com/problems/minimum-obstacle-removal-to-reach-corner/) | 0-1 BFS, Deque |
3373 | [Maximize the Number of Target Nodes After Connecting Trees II](https://leetcode.com/problems/maximize-the-number-of-target-nodes-after-connecting-trees-ii/) | [C++](./C++/maximize-the-number-of-target-nodes-after-connecting-trees-ii.cpp) [Python](./Python/maximize-the-number-of-target-nodes-after-connecting-trees-ii.py) | _O(n + m)_ | _O(n + m)_ | Hard | | BFS
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Depth-First Search
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2049 | [Count Nodes With the Highest Score](https://leetcode.com/problems/count-nodes-with-the-highest-score/) | [C++](./C++/count-nodes-with-the-highest-score.cpp) [Python](./Python/count-nodes-with-the-highest-score.py) | _O(n)_ | _O(n)_ | Medium | | |
2065 | [Maximum Path Quality of a Graph](https://leetcode.com/problems/maximum-path-quality-of-a-graph/) | [C++](./C++/maximum-path-quality-of-a-graph.cpp) [Python](./Python/maximum-path-quality-of-a-graph.py) | _O(\|V\| + \|E\| + 4^10)_ | _O(\|V\| + \|E\| )_ | Hard | | Pruning |
2192 | [All Ancestors of a Node in a Directed Acyclic Graph](https://leetcode.com/problems/all-ancestors-of-a-node-in-a-directed-acyclic-graph/) | [C++](./C++/all-ancestors-of-a-node-in-a-directed-acyclic-graph.cpp) [Python](./Python/all-ancestors-of-a-node-in-a-directed-acyclic-graph.py) | _O(\|V\| * \|E\|)_ | _O(\|V\| + \|E\|)_ | Medium | | DFS, BFS, Topological Sort |
2246 | [Longest Path With Different Adjacent Characters](https://leetcode.com/problems/longest-path-with-different-adjacent-characters/) | [C++](./C++/longest-path-with-different-adjacent-characters.cpp) [Python](./Python/longest-path-with-different-adjacent-characters.py) | _O(n)_ | _O(h)_ | Hard | | DFS, BFS, Topological Sort |
2265 | [Count Nodes Equal to Average of Subtree](https://leetcode.com/problems/count-nodes-equal-to-average-of-subtree/) | [C++](./C++/count-nodes-equal-to-average-of-subtree.cpp) [Python](./Python/count-nodes-equal-to-average-of-subtree.py) | _O(n)_ | _O(h)_ | Medium | | DFS, Tree |
2322 | [Minimum Score After Removals on a Tree](https://leetcode.com/problems/minimum-score-after-removals-on-a-tree/) | [C++](./C++/minimum-score-after-removals-on-a-tree.cpp) [Python](./Python/minimum-score-after-removals-on-a-tree.py) | _O(n^2)_ | _O(n)_ | Hard | | DFS, Tree |
2331 | [Evaluate Boolean Binary Tree](https://leetcode.com/problems/evaluate-boolean-binary-tree/) | [C++](./C++/evaluate-boolean-binary-tree.cpp) [Python](./Python/evaluate-boolean-binary-tree.py) | _O(n)_ | _O(h)_ | Easy | | DFS |
2385 | [Amount of Time for Binary Tree to Be Infected](https://leetcode.com/problems/amount-of-time-for-binary-tree-to-be-infected/) | [C++](./C++/amount-of-time-for-binary-tree-to-be-infected.cpp) [Python](./Python/amount-of-time-for-binary-tree-to-be-infected.py) | _O(n)_ | _O(h)_ | Medium | | BFS, DFS, Tree DP |
2445 | [Number of Nodes With Value One](https://leetcode.com/problems/number-of-nodes-with-value-one/)| [C++](./C++/number-of-nodes-with-value-one.cpp) [Python](./Python/number-of-nodes-with-value-one.py)| _O(q + h)_ | _O(q + h)_ | Medium | š | Tree, DFS, BFS |
2458 | [Height of Binary Tree After Subtree Removal Queries](https://leetcode.com/problems/height-of-binary-tree-after-subtree-removal-queries/)| [C++](./C++/height-of-binary-tree-after-subtree-removal-queries.cpp) [Python](./Python/height-of-binary-tree-after-subtree-removal-queries.py)| _O(n)_ | _O(n)_ | Hard | | Tree, DFS |
2467 | [Most Profitable Path in a Tree](https://leetcode.com/problems/most-profitable-path-in-a-tree/)| [C++](./C++/most-profitable-path-in-a-tree.cpp) [Python](./Python/most-profitable-path-in-a-tree.py)| _O(n)_ | _O(n)_ | Medium | | Tree, DFS |
2477 | [Minimum Fuel Cost to Report to the Capital](https://leetcode.com/problems/minimum-fuel-cost-to-report-to-the-capital/)| [C++](./C++/minimum-fuel-cost-to-report-to-the-capital.cpp) [Python](./Python/minimum-fuel-cost-to-report-to-the-capital.py)| _O(n)_ | _O(h)_ | Medium | | Tree, DFS |
2581 | [Count Number of Possible Root Nodes](https://leetcode.com/problems/count-number-of-possible-root-nodes/)| [C++](./C++/count-number-of-possible-root-nodes.cpp) [Python](./Python/count-number-of-possible-root-nodes.py)| _O(n)_ | _O(h)_ | Hard | | Tree, DFS |
2773 | [Height of Special Binary Tree](https://leetcode.com/problems/height-of-special-binary-tree/)| [C++](./C++/height-of-special-binary-tree.cpp) [Python](./Python/height-of-special-binary-tree.py)| _O(n)_ | _O(h)_ | Medium | š | Tree, DFS, BFS |
2791 | [Count Paths That Can Form a Palindrome in a Tree](https://leetcode.com/problems/count-paths-that-can-form-a-palindrome-in-a-tree/)| [C++](./C++/count-paths-that-can-form-a-palindrome-in-a-tree.cpp) [Python](./Python/count-paths-that-can-form-a-palindrome-in-a-tree.py)| _O(n)_ | _O(n)_ | Hard | | Tree, DFS, Freq Table |
2973 | [Find Number of Coins to Place in Tree Nodes](https://leetcode.com/problems/find-number-of-coins-to-place-in-tree-nodes/)| [C++](./C++/find-number-of-coins-to-place-in-tree-nodes.cpp) [Python](./Python/find-number-of-coins-to-place-in-tree-nodes.py)| _O(n)_ | _O(n)_ | Hard | | DFS |
3004 | [Maximum Subtree of the Same Color](https://leetcode.com/problems/maximum-subtree-of-the-same-color/)| [C++](./C++/maximum-subtree-of-the-same-color.cpp) [Python](./Python/maximum-subtree-of-the-same-color.py)| _O(n)_ | _O(h)_ | Medium | š | DFS |
3067 | [Count Pairs of Connectable Servers in a Weighted Tree Network](https://leetcode.com/problems/count-pairs-of-connectable-servers-in-a-weighted-tree-network/)| [C++](./C++/count-pairs-of-connectable-servers-in-a-weighted-tree-network.cpp) [Python](./Python/count-pairs-of-connectable-servers-in-a-weighted-tree-network.py)| _O(n^2)_ | _O(n)_ | Medium | | DFS, BFS |
3203 | [Find Minimum Diameter After Merging Two Trees](https://leetcode.com/problems/find-minimum-diameter-after-merging-two-trees/)| [C++](./C++/find-minimum-diameter-after-merging-two-trees.cpp) [Python](./Python/find-minimum-diameter-after-merging-two-trees.py)| _O(n + m)_ | _O(n + m)_ | Hard | variant of [Tree Diameter](https://leetcode.com/problems/tree-diameter/) | DFS, BFS, Tree DP, Tree Diameter |
3249 | [Count the Number of Good Nodes](https://leetcode.com/problems/count-the-number-of-good-nodes/)| [C++](./C++/count-the-number-of-good-nodes.cpp) [Python](./Python/count-the-number-of-good-nodes.py)| _O(n)_ | _O(h)_ | Medium | | DFS |
3319 | [K-th Largest Perfect Subtree Size in Binary Tree](https://leetcode.com/problems/k-th-largest-perfect-subtree-size-in-binary-tree/)| [C++](./C++/k-th-largest-perfect-subtree-size-in-binary-tree.cpp) [Python](./Python/k-th-largest-perfect-subtree-size-in-binary-tree.py)| _O(n)_ | _O(n)_ | Medium | | DFS, Quick Select |
3327 | [Check if DFS Strings Are Palindromes](https://leetcode.com/problems/check-if-dfs-strings-are-palindromes/)| [C++](./C++/check-if-dfs-strings-are-palindromes.cpp) [Python](./Python/check-if-dfs-strings-are-palindromes.py)| _O(n)_ | _O(n)_ | Hard | | DFS, `Manacher's Algorithm` |
3331 | [Find Subtree Sizes After Changes](https://leetcode.com/problems/find-subtree-sizes-after-changes/)| [C++](./C++/find-subtree-sizes-after-changes.cpp) [Python](./Python/find-subtree-sizes-after-changes.py)| _O(n)_ | _O(n)_ | Medium | | DFS, Hash Table |
3367 | [Maximize Sum of Weights after Edge Removals](https://leetcode.com/problems/maximize-sum-of-weights-after-edge-removals/)| [C++](./C++/maximize-sum-of-weights-after-edge-removals.cpp) [Python](./Python/maximize-sum-of-weights-after-edge-removals.py)| _O(n)_ | _O(n)_ | Hard | | DFS, Quick Select |
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Backtracking
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2014 | [Longest Subsequence Repeated k Times](https://leetcode.com/problems/longest-subsequence-repeated-k-times/) | [C++](./C++/longest-subsequence-repeated-k-times.cpp) [Python](./Python/longest-subsequence-repeated-k-times.py) | _O(n * (n/k)!)_ | _O(n/k)_ | Hard | | |
2056 | [Number of Valid Move Combinations On Chessboard](https://leetcode.com/problems/number-of-valid-move-combinations-on-chessboard/) | [C++](./C++/number-of-valid-move-combinations-on-chessboard.cpp) [Python](./Python/number-of-valid-move-combinations-on-chessboard.py) | _O(1)_ | _O(1)_ | Hard | | |
2094 | [Finding 3-Digit Even Numbers](https://leetcode.com/problems/finding-3-digit-even-numbers/) | [C++](./C++/finding-3-digit-even-numbers.cpp) [Python](./Python/finding-3-digit-even-numbers.py) | _O(n)_ | _O(1)_ | Easy | | |
2443 | [Sum of Number and Its Reverse](https://leetcode.com/problems/sum-of-number-and-its-reverse/) | [C++](./C++/sum-of-number-and-its-reverse.cpp) [Python](./Python/sum-of-number-and-its-reverse.py) | _O(n^(1/(2*log2(10))))_ | _O(log10(n)/2)_ | Medium | | Brute Force, Backtracking
2664 | [The Knightās Tour](https://leetcode.com/problems/the-knights-tour/) | [C++](./C++/the-knights-tour.cpp) [Python](./Python/the-knights-tour.py) | _O(m * n)_ | _O(1)_ | Medium | š | Backtracking, Greedy, `Warnsdorff's Rule`
2698 | [Find the Punishment Number of an Integer](https://leetcode.com/problems/find-the-punishment-number-of-an-integer/) | [C++](./C++/find-the-punishment-number-of-an-integer.cpp) [Python](./Python/find-the-punishment-number-of-an-integer.py) | _O(n * (logn)^(2*logn))_ | _O(logn)_ | Medium | | Backtracking
2741 | [Special Permutations](https://leetcode.com/problems/special-permutations/) | [C++](./C++/special-permutations.cpp) [Python](./Python/special-permutations.py) | _O(n^2 * 2^n)_ | _O(n * 2^n)_ | Medium | | Backtracking, Memoization
3211 | [Generate Binary Strings Without Adjacent Zeros](https://leetcode.com/problems/generate-binary-strings-without-adjacent-zeros/) | [C++](./C++/generate-binary-strings-without-adjacent-zeros.cpp) [Python](./Python/generate-binary-strings-without-adjacent-zeros.py) | _O(n * 2^n)_ | _O(n)_ | Medium | | Backtracking, BFS
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Dynamic Programming
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2002 | [Maximum Product of the Length of Two Palindromic Subsequences](https://leetcode.com/problems/maximum-product-of-the-length-of-two-palindromic-subsequences/)| [C++](./C++/maximum-product-of-the-length-of-two-palindromic-subsequences.cpp) [Python](./Python/maximum-product-of-the-length-of-two-palindromic-subsequences.py) | _O(3^n)_ | _O(2^n)_ | Medium | | DP, Submask Enumeration
2008 | [Maximum Earnings From Taxi](https://leetcode.com/problems/maximum-earnings-from-taxi/)| [C++](./C++/maximum-earnings-from-taxi.cpp) [Python](./Python/maximum-earnings-from-taxi.py) | _O(n + mlogm)_ | _O(n)_ | Medium | | DP
2019 | [The Score of Students Solving Math Expression](https://leetcode.com/problems/the-score-of-students-solving-math-expression/) | [C++](./C++/the-score-of-students-solving-math-expression.cpp) [Python](./Python/the-score-of-students-solving-math-expression.py) | _O(n^3 * a^2)_ | _O(n^2)_ | Hard | variant of [Burst Balloons](https://leetcode.com/problems/burst-balloons/) |
2031 | [Count Subarrays With More Ones Than Zeros](https://leetcode.com/problems/count-subarrays-with-more-ones-than-zeros/) | [C++](./C++/count-subarrays-with-more-ones-than-zeros.cpp) [Python](./Python/count-subarrays-with-more-ones-than-zeros.py) | _O(n)_ | _O(n)_ | Medium | š | Prefix Sum, DP
2044 | [Count Number of Maximum Bitwise-OR Subsets](https://leetcode.com/problems/count-number-of-maximum-bitwise-or-subsets/) | [C++](./C++/count-number-of-maximum-bitwise-or-subsets.cpp) [Python](./Python/count-number-of-maximum-bitwise-or-subsets.py) | _O(min(2^n, m * n))_ | _O(min(2^n, m))_ | Medium | | DP
2052 | [Minimum Cost to Separate Sentence Into Rows](https://leetcode.com/problems/minimum-cost-to-separate-sentence-into-rows/) | [C++](./C++/minimum-cost-to-separate-sentence-into-rows.cpp) [Python](./Python/minimum-cost-to-separate-sentence-into-rows.py) | _O(s + n * k)_ | _O(k)_ | Medium | š | DP
2060 | [Check if an Original String Exists Given Two Encoded Strings](https://leetcode.com/problems/check-if-an-original-string-exists-given-two-encoded-strings/) | [C++](./C++/check-if-an-original-string-exists-given-two-encoded-strings.cpp) [Python](./Python/check-if-an-original-string-exists-given-two-encoded-strings.py) | _O(m * n * k)_ | _O(min(m, n) * k)_ | Hard | | DP, Memoization
2088 | [Count Fertile Pyramids in a Land](https://leetcode.com/problems/count-fertile-pyramids-in-a-land/) | [C++](./C++/count-fertile-pyramids-in-a-land.cpp) [Python](./Python/count-fertile-pyramids-in-a-land.py) | _O(m * n)_ | _O(n)_ | Hard | | DP
2140 | [Solving Questions With Brainpower](https://leetcode.com/problems/solving-questions-with-brainpower/) | [C++](./C++/solving-questions-with-brainpower.cpp) [Python](./Python/solving-questions-with-brainpower.py) | _O(n)_ | _O(n)_ | Medium | | DP
2143 | [Choose Numbers From Two Arrays in Range](https://leetcode.com/problems/choose-numbers-from-two-arrays-in-range/) | [C++](./C++/choose-numbers-from-two-arrays-in-range.cpp) [Python](./Python/choose-numbers-from-two-arrays-in-range.py) | _O(n^2 * v)_ | _O(n * v)_ | Hard | š | DP
2167 | [Minimum Time to Remove All Cars Containing Illegal Goods](https://leetcode.com/problems/minimum-time-to-remove-all-cars-containing-illegal-goods/) | [C++](./C++/minimum-time-to-remove-all-cars-containing-illegal-goods.cpp) [Python](./Python/minimum-time-to-remove-all-cars-containing-illegal-goods.py) | _O(n)_ | _O(1)_ | Hard || DP
2174 | [Remove All Ones With Row and Column Flips II](https://leetcode.com/problems/remove-all-ones-with-row-and-column-flips-ii/) | [C++](./C++/remove-all-ones-with-row-and-column-flips-ii.cpp) [Python](./Python/remove-all-ones-with-row-and-column-flips-ii.py) | _O((m * n) * 2^(m * n))_ | _O(2^(m * n))_ | Medium | š | DP, Bitmasks
2184 | [Number of Ways to Build Sturdy Brick Wall](https://leetcode.com/problems/number-of-ways-to-build-sturdy-brick-wall/)|[C++](./C++/number-of-ways-to-build-sturdy-brick-wall.cpp) [Python](./Python/number-of-ways-to-build-sturdy-brick-wall.py)| _O(h * p^2)_ | _O(p^2)_ | Medium | š, variant of [Painting a Grid With Three Different Colors](https://leetcode.com/problems/painting-a-grid-with-three-different-colors/) | DP, Backtracking, Matrix Exponentiation |
2188 | [Minimum Time to Finish the Race](https://leetcode.com/problems/minimum-time-to-finish-the-race/) | [C++](./C++/minimum-time-to-finish-the-race.cpp) [Python](./Python/minimum-time-to-finish-the-race.py) | _O((n + l) * logc)_ | _O(n + l + logc)_ | Hard || Greedy, DP
2189 | [Number of Ways to Build House of Cards](https://leetcode.com/problems/number-of-ways-to-build-house-of-cards/) | [C++](./C++/number-of-ways-to-build-house-of-cards.cpp) [Python](./Python/number-of-ways-to-build-house-of-cards.py) | _O(n^2)_ | _O(n)_ | Medium | š | DP
2209 | [Minimum White Tiles After Covering With Carpets](https://leetcode.com/problems/minimum-white-tiles-after-covering-with-carpets/) | [C++](./C++/minimum-white-tiles-after-covering-with-carpets.cpp) [Python](./Python/minimum-white-tiles-after-covering-with-carpets.py) | _O(m * n)_ | _O(m * n)_ | Hard || DP
2218 | [Maximum Value of K Coins From Piles](https://leetcode.com/problems/maximum-value-of-k-coins-from-piles/) | [C++](./C++/maximum-value-of-k-coins-from-piles.cpp) [Python](./Python/maximum-value-of-k-coins-from-piles.py) | _O(min(n * k^2, m * k)))_ | _O(k)_ | Hard || DP
2222 | [Number of Ways to Select Buildings](https://leetcode.com/problems/number-of-ways-to-select-buildings/) | [C++](./C++/number-of-ways-to-select-buildings.cpp) [Python](./Python/number-of-ways-to-select-buildings.py) | _O(n)_ | _O(1)_ | Medium || DP
2247 | [Maximum Cost of Trip With K Highways](https://leetcode.com/problems/maximum-cost-of-trip-with-k-highways/) | [C++](./C++/maximum-cost-of-trip-with-k-highways.cpp) [Python](./Python/maximum-cost-of-trip-with-k-highways.py) | _O(n^2 * 2^n)_ | _O(n * 2^n)_ | Hard | š | DP, Bitmasks, BFS
2266 | [Count Number of Texts](https://leetcode.com/problems/count-number-of-texts/) | [C++](./C++/count-number-of-texts.cpp) [Python](./Python/count-number-of-texts.py) | _O(n)_ | _O(1)_ | Medium | | DP
2267 | [Check if There Is a Valid Parentheses String Path](https://leetcode.com/problems/check-if-there-is-a-valid-parentheses-string-path/) | [C++](./C++/check-if-there-is-a-valid-parentheses-string-path.cpp) [Python](./Python/check-if-there-is-a-valid-parentheses-string-path.py) | _O(m * n * (m + n) / 32)_ | _O(n * (m + n) / 32)_ | Hard | variant of [Codeforces Round #801 C](https://codeforces.com/contest/1695/problem/C)| DP, Bitsets
2289 | [Steps to Make Array Non-decreasing](https://leetcode.com/problems/steps-to-make-array-non-decreasing/) | [C++](./C++/steps-to-make-array-non-decreasing.cpp) [Python](./Python/steps-to-make-array-non-decreasing.py) | _O(n)_ | _O(n)_ | Hard | | DP, Mono Stack
2291 | [Maximum Profit From Trading Stocks](https://leetcode.com/problems/maximum-profit-from-trading-stocks/) | [C++](./C++/maximum-profit-from-trading-stocks.cpp) [Python](./Python/maximum-profit-from-trading-stocks.py) | _O(n * b)_ | _O(b)_ | Medium | š | DP
2297 | [Jump Game IX](https://leetcode.com/problems/jump-game-ix/) | [C++](./C++/jump-game-ix.cpp) [Python](./Python/jump-game-ix.py) | _O(n)_ | _O(1)_ | Medium | š | DP, Mono Stack
2304 | [Minimum Path Cost in a Grid](https://leetcode.com/problems/minimum-path-cost-in-a-grid/) | [C++](./C++/minimum-path-cost-in-a-grid.cpp) [Python](./Python/minimum-path-cost-in-a-grid.py) | _O(m * n^2)_ | _O(n)_ | Medium | | DP
2305 | [Fair Distribution of Cookies](https://leetcode.com/problems/fair-distribution-of-cookies/) | [C++](./C++/fair-distribution-of-cookies.cpp) [Python](./Python/fair-distribution-of-cookies.py) | _O(k * 3^n)_ | _O(2^n)_ | Medium | | DP, Submask Enumeration
2312 | [Selling Pieces of Wood](https://leetcode.com/problems/selling-pieces-of-wood/) | [C++](./C++/selling-pieces-of-wood.cpp) [Python](./Python/selling-pieces-of-wood.py) | _O(m * n * (m + n))_ | _O(m + n)_ | Hard | | DP
2313 | [Minimum Flips in Binary Tree to Get Result](https://leetcode.com/problems/minimum-flips-in-binary-tree-to-get-result/) | [C++](./C++/minimum-flips-in-binary-tree-to-get-result.cpp) [Python](./Python/minimum-flips-in-binary-tree-to-get-result.py) | _O(n)_ | _O(h)_ | Hard | š | Tree DP
2318 | [Number of Distinct Roll Sequences](https://leetcode.com/problems/number-of-distinct-roll-sequences/) | [C++](./C++/number-of-distinct-roll-sequences.cpp) [Python](./Python/number-of-distinct-roll-sequences.py) | _O(6^3 * n)_ | _O(6^2)_ | Hard | | DP
2320 | [Count Number of Ways to Place Houses](https://leetcode.com/problems/count-number-of-ways-to-place-houses/)| [C++](./C++/count-number-of-ways-to-place-houses.cpp) [Python](./Python/count-number-of-ways-to-place-houses.py) | _O(logn)_ | _O(1)_ | Medium | variant of [Fibonacci Number](https://leetcode.com/problems/fibonacci-number/) | Matrix Exponentiation
2327 | [Number of People Aware of a Secret](https://leetcode.com/problems/number-of-people-aware-of-a-secret/)| [C++](./C++/number-of-people-aware-of-a-secret.cpp) [Python](./Python/number-of-people-aware-of-a-secret.py) | _O(n)_ | _O(f)_ | Medium | | DP
2328 | [Number of Increasing Paths in a Grid](https://leetcode.com/problems/number-of-increasing-paths-in-a-grid/)| [C++](./C++/number-of-increasing-paths-in-a-grid.cpp) [Python](./Python/number-of-increasing-paths-in-a-grid.py) | _O(m * n)_ | _O(m * n)_ | Hard | | Memoization, Topological Sort, DP
2361 | [Minimum Costs Using the Train Line](https://leetcode.com/problems/minimum-costs-using-the-train-line/)| [C++](./C++/minimum-costs-using-the-train-line.cpp) [Python](./Python/minimum-costs-using-the-train-line.py) | _O(n)_ | _O(1)_ | Hard | š | DP
2369 | [Check if There is a Valid Partition For The Array](https://leetcode.com/problems/check-if-there-is-a-valid-partition-for-the-array/)| [C++](./C++/check-if-there-is-a-valid-partition-for-the-array.cpp) [Python](./Python/check-if-there-is-a-valid-partition-for-the-array.py) | _O(n)_ | _O(1)_ | Medium | | DP
2370 | [Longest Ideal Subsequence](https://leetcode.com/problems/longest-ideal-subsequence/)| [C++](./C++/longest-ideal-subsequence.cpp) [Python](./Python/longest-ideal-subsequence.py) | _O(n)_ | _O(1)_ | Medium | | DP
2378 | [Choose Edges to Maximize Score in a Tree](https://leetcode.com/problems/choose-edges-to-maximize-score-in-a-tree/) | [C++](./C++/choose-edges-to-maximize-score-in-a-tree.cpp) [Python](./Python/choose-edges-to-maximize-score-in-a-tree.py) | _O(n)_ | _O(n)_ | Medium |š| DFS, Stack, Tree DP |
2380 | [Time Needed to Rearrange a Binary String](https://leetcode.com/problems/time-needed-to-rearrange-a-binary-string/)| [C++](./C++/time-needed-to-rearrange-a-binary-string.cpp) [Python](./Python/time-needed-to-rearrange-a-binary-string.py) | _O(n)_ | _O(1)_ | Medium | | DP
2403 | [Minimum Time to Kill All Monsters](https://leetcode.com/problems/minimum-time-to-kill-all-monsters/)| [C++](./C++/minimum-time-to-kill-all-monsters.cpp) [Python](./Python/minimum-time-to-kill-all-monsters.py) | _O(n * 2^n)_ | _O(2^n)_ | Hard |š| Bitmasks, DP
2420 | [Find All Good Indices](https://leetcode.com/problems/find-all-good-indices/)| [C++](./C++/find-all-good-indices.cpp) [Python](./Python/find-all-good-indices.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum
2430 | [Maximum Deletions on a String](https://leetcode.com/problems/maximum-deletions-on-a-string/)| [C++](./C++/maximum-deletions-on-a-string.cpp) [Python](./Python/maximum-deletions-on-a-string.py) | _O(n^2)_ | _O(n)_ | Hard | | DP, `Rabin-Karp Algorithm`, Rolling Hash, Longest Prefix Suffix, `KMP Algorithm`
2431 | [Maximize Total Tastiness of Purchased Fruits](https://leetcode.com/problems/maximize-total-tastiness-of-purchased-fruits/)| [C++](./C++/maximize-total-tastiness-of-purchased-fruits.cpp) [Python](./Python/maximize-total-tastiness-of-purchased-fruits.py) | _O(n * a * c)_ | _O(a * c)_ | Medium |š| DP
2435 | [Paths in Matrix Whose Sum Is Divisible by K](https://leetcode.com/problems/paths-in-matrix-whose-sum-is-divisible-by-k/)| [C++](./C++/paths-in-matrix-whose-sum-is-divisible-by-k.cpp) [Python](./Python/paths-in-matrix-whose-sum-is-divisible-by-k.py) | _O(m * n * k)_ | _O(n * k)_ | Hard || DP
2447 | [Number of Subarrays With GCD Equal to K](https://leetcode.com/problems/number-of-subarrays-with-gcd-equal-to-k/)| [C++](./C++/number-of-subarrays-with-gcd-equal-to-k.cpp) [Python](./Python/number-of-subarrays-with-gcd-equal-to-k.py) | _O(nlogr)_ | _O(logr)_ | Medium || DP
2463 | [Minimum Total Distance Traveled](https://leetcode.com/problems/minimum-total-distance-traveled/)| [C++](./C++/minimum-total-distance-traveled.cpp) [Python](./Python/minimum-total-distance-traveled.py) | _O(mlogm + nlogn + m * n)_ | _O(n)_ | Hard || Sort, DP, Prefix Sum, Mono Deque
2464 | [Minimum Subarrays in a Valid Split](https://leetcode.com/problems/minimum-subarrays-in-a-valid-split/)| [C++](./C++/minimum-subarrays-in-a-valid-split.cpp) [Python](./Python/minimum-subarrays-in-a-valid-split.py) | _O(n^2 * logr)_ | _O(n)_ | Medium | š | DP
2466 | [Count Ways To Build Good Strings](https://leetcode.com/problems/count-ways-to-build-good-strings/)| [C++](./C++/count-ways-to-build-good-strings.cpp) [Python](./Python/count-ways-to-build-good-strings.py) | _O(n)_ | _O(n)_ | Medium | | DP
2470 | [Number of Subarrays With LCM Equal to K](https://leetcode.com/problems/number-of-subarrays-with-lcm-equal-to-k/)| [C++](./C++/number-of-subarrays-with-lcm-equal-to-k.cpp) [Python](./Python/number-of-subarrays-with-lcm-equal-to-k.py) | _O(n * sqrt(k) * logk)_ | _O(sqrt(k))_ | Medium | variant of [Number of Subarrays With GCD Equal to K](https://leetcode.com/problems/number-of-subarrays-with-gcd-equal-to-k/) | DP
2470 | [Number of Subarrays With LCM Equal to K](https://leetcode.com/problems/number-of-subarrays-with-lcm-equal-to-k/)| [C++](./C++/number-of-subarrays-with-lcm-equal-to-k.cpp) [Python](./Python/number-of-subarrays-with-lcm-equal-to-k.py) | _O(n * sqrt(k) * logk)_ | _O(sqrt(k))_ | Medium | variant of [Number of Subarrays With GCD Equal to K](https://leetcode.com/problems/number-of-subarrays-with-gcd-equal-to-k/) | DP
2475 | [Number of Unequal Triplets in Array](https://leetcode.com/problems/number-of-unequal-triplets-in-array/)| [C++](./C++/number-of-unequal-triplets-in-array.cpp) [Python](./Python/number-of-unequal-triplets-in-array.py) | _O(n)_ | _O(n)_ | Easy | | DP, Freq Table, Math
2478 | [Number of Beautiful Partitions](https://leetcode.com/problems/number-of-beautiful-partitions/)| [C++](./C++/number-of-beautiful-partitions.cpp) [Python](./Python/number-of-beautiful-partitions.py) | _O(n * k)_ | _O(n)_ | Hard | | DP
2495 | [Number of Subarrays Having Even Product](https://leetcode.com/problems/number-of-subarrays-having-even-product/)| [C++](./C++/number-of-subarrays-having-even-product.cpp) [Python](./Python/number-of-subarrays-having-even-product.py) | _O(n)_ | _O(1)_ | Medium | š | DP, Math
2510 | [Check if There is a Path With Equal Number of 0's And 1's](https://leetcode.com/problems/check-if-there-is-a-path-with-equal-number-of-0s-and-1s/)| [C++](./C++/check-if-there-is-a-path-with-equal-number-of-0s-and-1s.cpp) [Python](./Python/check-if-there-is-a-path-with-equal-number-of-0s-and-1s.py) | _O(m * n)_ | _O(n)_ | Medium | š | DP
2518 | [Number of Great Partitions](https://leetcode.com/problems/number-of-great-partitions/)| [C++](./C++/number-of-great-partitions.cpp) [Python](./Python/number-of-great-partitions.py) | _O(n * k)_ | _O(k)_ | Hard | | Knapsack DP
2533 | [Number of Good Binary Strings](https://leetcode.com/problems/number-of-good-binary-strings/)| [C++](./C++/number-of-good-binary-strings.cpp) [Python](./Python/number-of-good-binary-strings.py) | _O(n)_ | _O(w)_ | Medium | š | DP
2538 | [Difference Between Maximum and Minimum Price Sum](https://leetcode.com/problems/difference-between-maximum-and-minimum-price-sum/)| [C++](./C++/difference-between-maximum-and-minimum-price-sum.cpp) [Python](./Python/difference-between-maximum-and-minimum-price-sum.py) | _O(n)_ | _O(n)_ | Hard | | DFS, Tree DP
2547 | [Minimum Cost to Split an Array](https://leetcode.com/problems/minimum-cost-to-split-an-array/)| [C++](./C++/minimum-cost-to-split-an-array.cpp) [Python](./Python/minimum-cost-to-split-an-array.py) | _O(n^2)_ | _O(n)_ | Hard | | DP
2552 | [Count Increasing Quadruplets](https://leetcode.com/problems/count-increasing-quadruplets/)| [C++](./C++/count-increasing-quadruplets.cpp) [Python](./Python/count-increasing-quadruplets.py) | _O(n^2)_ | _O(n)_ | Hard | variant of [132 Pattern](https://leetcode.com/problems/132-pattern/) | DP, Prefix Sum
2556 | [Disconnect Path in a Binary Matrix by at Most One Flip](https://leetcode.com/problems/disconnect-path-in-a-binary-matrix-by-at-most-one-flip/)| [C++](./C++/disconnect-path-in-a-binary-matrix-by-at-most-one-flip.cpp) [Python](./Python/disconnect-path-in-a-binary-matrix-by-at-most-one-flip.py) | _O(m * n)_ | _O(m + n)_ | Medium | | DP, DFS
2565 | [Subsequence With the Minimum Score](https://leetcode.com/problems/subsequence-with-the-minimum-score/)| [C++](./C++/subsequence-with-the-minimum-score.cpp) [Python](./Python/subsequence-with-the-minimum-score.py) | _O(n)_ | _O(n)_ | Hard | | Two Pointers, DP
2572 | [Count the Number of Square-Free Subsets](https://leetcode.com/problems/count-the-number-of-square-free-subsets/) | [C++](./C++/count-the-number-of-square-free-subsets.cpp) [Python](./Python/count-the-number-of-square-free-subsets.py) | _O(n + m * 2^p)_ | _O(m * 2^p)_ | Medium | | Number Theory, Combinatorics, Bitmasks, Memoization, DP
2585 | [Number of Ways to Earn Points](https://leetcode.com/problems/number-of-ways-to-earn-points/) | [C++](./C++/number-of-ways-to-earn-points.cpp) [Python](./Python/number-of-ways-to-earn-points.py) | _O(n * t * c)_ | _O(t)_ | Hard | | Knapsack DP
2597 | [The Number of Beautiful Subsets](https://leetcode.com/problems/the-number-of-beautiful-subsets/) | [C++](./C++/the-number-of-beautiful-subsets.cpp) [Python](./Python/the-number-of-beautiful-subsets.py) | _O(n)_ | _O(n)_ | Medium | | Combinatorics, DP
2638 | [Count the Number of K-Free Subsets](https://leetcode.com/problems/count-the-number-of-k-free-subsets/) | [C++](./C++/count-the-number-of-k-free-subsets.cpp) [Python](./Python/count-the-number-of-k-free-subsets.py) | _O(n)_ | _O(n)_ | Medium | š, variant of [The Number of Beautiful Subsets](https://leetcode.com/problems/the-number-of-beautiful-subsets/) | Combinatorics, DP
2646 | [Minimize the Total Price of the Trips](https://leetcode.com/problems/minimize-the-total-price-of-the-trips/) | [C++](./C++/minimize-the-total-price-of-the-trips.cpp) [Python](./Python/minimize-the-total-price-of-the-trips.py) | _O(t * n)_ | _O(n)_ | Hard | | DFS, Tree DP
2681 | [Power of Heroes](https://leetcode.com/problems/power-of-heroes/) | [C++](./C++/power-of-heroes.cpp) [Python](./Python/power-of-heroes.py) | _O(nlogn)_ | _O(1)_ | Hard | | Sort, Combinatorics, DP
2684 | [Maximum Number of Moves in a Grid](https://leetcode.com/problems/maximum-number-of-moves-in-a-grid/) | [C++](./C++/maximum-number-of-moves-in-a-grid.cpp) [Python](./Python/maximum-number-of-moves-in-a-grid.py) | _O(m * n)_ | _O(m)_ | Medium | | DP, BFS
2707 | [Extra Characters in a String](https://leetcode.com/problems/extra-characters-in-a-string/) | [C++](./C++/extra-characters-in-a-string.cpp) [Python](./Python/extra-characters-in-a-string.py) | _O(n * l)_ | _O(n + t)_ | Medium | | DP, Trie
2713 | [Maximum Strictly Increasing Cells in a Matrix](https://leetcode.com/problems/maximum-strictly-increasing-cells-in-a-matrix/) | [C++](./C++/maximum-strictly-increasing-cells-in-a-matrix.cpp) [Python](./Python/maximum-strictly-increasing-cells-in-a-matrix.py) | _O(m * n * log(m * n))_ | _O(m * n)_ | Hard | | Sort, DP
2719 | [Count of Integers](https://leetcode.com/problems/count-of-integers/) | [C++](./C++/count-of-integers.cpp) [Python](./Python/count-of-integers.py) | _O(m * n)_ | _O(m + n)_ | Hard | | Combinatorics, DP
2742 | [Painting the Walls](https://leetcode.com/problems/painting-the-walls/) | [C++](./C++/painting-the-walls.cpp) [Python](./Python/painting-the-walls.py) | _O(n^2)_ | _O(n)_ | Hard | | Knapsack DP
2746 | [Decremental String Concatenation](https://leetcode.com/problems/decremental-string-concatenation/) | [C++](./C++/decremental-string-concatenation.cpp) [Python](./Python/decremental-string-concatenation.py) | _O(n)_ | _O(1)_ | Medium | | DP
2767 | [Partition String Into Minimum Beautiful Substrings](https://leetcode.com/problems/partition-string-into-minimum-beautiful-substrings/) | [C++](./C++/partition-string-into-minimum-beautiful-substrings.cpp) [Python](./Python/partition-string-into-minimum-beautiful-substrings.py) | _O(n^2)_ | _O(n)_ | Medium | | DP
2770 | [Maximum Number of Jumps to Reach the Last Index](https://leetcode.com/problems/maximum-number-of-jumps-to-reach-the-last-index/) | [C++](./C++/maximum-number-of-jumps-to-reach-the-last-index.cpp) [Python](./Python/maximum-number-of-jumps-to-reach-the-last-index.py) | _O(n^2)_ | _O(n)_ | Medium | | DP
2771 | [Longest Non-decreasing Subarray From Two Arrays](https://leetcode.com/problems/longest-non-decreasing-subarray-from-two-arrays/) | [C++](./C++/longest-non-decreasing-subarray-from-two-arrays.cpp) [Python](./Python/longest-non-decreasing-subarray-from-two-arrays.py) | _O(n)_ | _O(1)_ | Medium | | DP
2786 | [Visit Array Positions to Maximize Score](https://leetcode.com/problems/visit-array-positions-to-maximize-score/) | [C++](./C++/visit-array-positions-to-maximize-score.cpp) [Python](./Python/visit-array-positions-to-maximize-score.py) | _O(n)_ | _O(1)_ | Medium | | DP
2787 | [Ways to Express an Integer as Sum of Powers](https://leetcode.com/problems/ways-to-express-an-integer-as-sum-of-powers/) | [C++](./C++/ways-to-express-an-integer-as-sum-of-powers.cpp) [Python](./Python/ways-to-express-an-integer-as-sum-of-powers.py) | _O(nlogn)_ | _O(n)_ | Medium | | Knapsack DP
2801 | [Count Stepping Numbers in Range](https://leetcode.com/problems/count-stepping-numbers-in-range/) | [C++](./C++/count-stepping-numbers-in-range.cpp) [Python](./Python/count-stepping-numbers-in-range.py) | _O(n)_ | _O(1)_ | Hard | | DP
2809 | [Minimum Time to Make Array Sum At Most x](https://leetcode.com/problems/minimum-time-to-make-array-sum-at-most-x/) | [C++](./C++/minimum-time-to-make-array-sum-at-most-x.cpp) [Python](./Python/minimum-time-to-make-array-sum-at-most-x.py) | _O(n^2)_ | _O(n)_ | Hard | | Sort, Greedy, DP, Linear Search
2826 | [Sorting Three Groups](https://leetcode.com/problems/sorting-three-groups/) | [C++](./C++/sorting-three-groups.cpp) [Python](./Python/sorting-three-groups.py) | _O(n)_ | _O(1)_ | Medium | | DP
2827 | [Number of Beautiful Integers in the Range](https://leetcode.com/problems/number-of-beautiful-integers-in-the-range/) | [C++](./C++/number-of-beautiful-integers-in-the-range.cpp) [Python](./Python/number-of-beautiful-integers-in-the-range.py) | _O(n^2 * k)_ | _O(n * k)_ | Hard | | DP, Memoization
2830 | [Maximize the Profit as the Salesman](https://leetcode.com/problems/maximize-the-profit-as-the-salesman/) | [C++](./C++/maximize-the-profit-as-the-salesman.cpp) [Python](./Python/maximize-the-profit-as-the-salesman.py) | _O(n + m)_ | _O(n + m)_ | Medium | | DP
2858 | [Minimum Edge Reversals So Every Node Is Reachable](https://leetcode.com/problems/minimum-edge-reversals-so-every-node-is-reachable/) | [C++](./C++/minimum-edge-reversals-so-every-node-is-reachable.cpp) [Python](./Python/minimum-edge-reversals-so-every-node-is-reachable.py) | _O(n)_ | _O(n)_ | Hard | | DFS, Tree DP
2867 | [Count Valid Paths in a Tree](https://leetcode.com/problems/count-valid-paths-in-a-tree/) | [C++](./C++/count-valid-paths-in-a-tree.cpp) [Python](./Python/count-valid-paths-in-a-tree.py) | _O(n)_ | _O(n)_ | Hard | | Number Theory, `Linear Sieve of Eratosthenes`, DFS, Tree DP, Union Find
2896 | [Apply Operations to Make Two Strings Equal](https://leetcode.com/problems/apply-operations-to-make-two-strings-equal/) | [C++](./C++/apply-operations-to-make-two-strings-equal.cpp) [Python](./Python/apply-operations-to-make-two-strings-equal.py) | _O(n)_ | _O(1)_ | Medium | | DP
2901 | [Longest Unequal Adjacent Groups Subsequence II](https://leetcode.com/problems/longest-unequal-adjacent-groups-subsequence-ii/) | [C++](./C++/longest-unequal-adjacent-groups-subsequence-ii.cpp) [Python](./Python/longest-unequal-adjacent-groups-subsequence-ii.py) | _O(n^2)_ | _O(n)_ | Medium | | DP, Backtracing, LIS DP
2902 | [Count of Sub-Multisets With Bounded Sum](https://leetcode.com/problems/count-of-sub-multisets-with-bounded-sum/) | [C++](./C++/count-of-sub-multisets-with-bounded-sum.cpp) [Python](./Python/count-of-sub-multisets-with-bounded-sum.py) | _O(n + d * r)_ | _O(d + r)_ | Hard | | Freq Table, DP, Sliding Window, Combinatorics
2911 | [Minimum Changes to Make K Semi-palindromes](https://leetcode.com/problems/minimum-changes-to-make-k-semi-palindromes/) | [C++](./C++/minimum-changes-to-make-k-semi-palindromes.cpp) [Python](./Python/minimum-changes-to-make-k-semi-palindromes.py) | _O(n^3)_ | _O(n^2 * logn)_ | Hard | | Number Theory, DP
2912 | [Number of Ways to Reach Destination in the Grid](https://leetcode.com/problems/number-of-ways-to-reach-destination-in-the-grid/) | [C++](./C++/number-of-ways-to-reach-destination-in-the-grid.cpp) [Python](./Python/number-of-ways-to-reach-destination-in-the-grid.py) | _O(logn)_ | _O(1)_ | Hard | š | DP, Matrix Exponentiation
2913 | [Subarrays Distinct Element Sum of Squares I](https://leetcode.com/problems/subarrays-distinct-element-sum-of-squares-i/) | [C++](./C++/subarrays-distinct-element-sum-of-squares-i.cpp) [Python](./Python/subarrays-distinct-element-sum-of-squares-i.py) | _O(nlogn)_ | _O(n)_ | Easy | | DP, Segment Tree, BIT, Fenwick Tree, Ordered Set, Sorted List, Math, Hash Table
2915 | [Length of the Longest Subsequence That Sums to Target](https://leetcode.com/problems/length-of-the-longest-subsequence-that-sums-to-target/) | [C++](./C++/length-of-the-longest-subsequence-that-sums-to-target.cpp) [Python](./Python/length-of-the-longest-subsequence-that-sums-to-target.py) | _O(n * t)_ | _O(t)_ | Medium | | Knapsack DP
2916 | [Subarrays Distinct Element Sum of Squares II](https://leetcode.com/problems/subarrays-distinct-element-sum-of-squares-ii/) | [C++](./C++/subarrays-distinct-element-sum-of-squares-ii.cpp) [Python](./Python/subarrays-distinct-element-sum-of-squares-ii.py) | _O(nlogn)_ | _O(n)_ | Easy | | DP, Segment Tree, BIT, Fenwick Tree, Ordered Set, Sorted List, Math
2919 | [Minimum Increment Operations to Make Array Beautiful](https://leetcode.com/problems/minimum-increment-operations-to-make-array-beautiful/) | [C++](./C++/minimum-increment-operations-to-make-array-beautiful.cpp) [Python](./Python/minimum-increment-operations-to-make-array-beautiful.py) | _O(n)_ | _O(1)_ | Medium | | DP
2920 | [Maximum Points After Collecting Coins From All Nodes](https://leetcode.com/problems/maximum-points-after-collecting-coins-from-all-nodes/) | [C++](./C++/maximum-points-after-collecting-coins-from-all-nodes.cpp) [Python](./Python/maximum-points-after-collecting-coins-from-all-nodes.py) | _O(nlogr)_ | _O(n)_ | Hard | | Tree DP, Memoization, DFS, Pruning
2925 | [Maximum Score After Applying Operations on a Tree](https://leetcode.com/problems/maximum-score-after-applying-operations-on-a-tree/) | [C++](./C++/maximum-score-after-applying-operations-on-a-tree.cpp) [Python](./Python/maximum-score-after-applying-operations-on-a-tree.py) | _O(n)_ | _O(n)_ | Medium | | DFS, Tree DP
2941 | [Maximum GCD-Sum of a Subarray](https://leetcode.com/problems/maximum-gcd-sum-of-a-subarray/) | [C++](./C++/maximum-gcd-sum-of-a-subarray.cpp) [Python](./Python/maximum-gcd-sum-of-a-subarray.py) | _O(nlogr)_ | _O(logr)_ | Hard | š | Number Theory, DP, Prefix Sum, Binary Search, RMQ, Sparse Table
2944 | [Minimum Number of Coins for Fruits](https://leetcode.com/problems/minimum-number-of-coins-for-fruits/) | [C++](./C++/minimum-number-of-coins-for-fruits.cpp) [Python](./Python/minimum-number-of-coins-for-fruits.py) | _O(n)_ | _O(n)_ | Medium | | DP, Sorted List, BST, Mono Deque
2945 | [Find Maximum Non-decreasing Array Length](https://leetcode.com/problems/find-maximum-non-decreasing-array-length/) | [C++](./C++/find-maximum-non-decreasing-array-length.cpp) [Python](./Python/find-maximum-non-decreasing-array-length.py) | _O(n)_ | _O(n)_ | Hard | | DP, Greedy, Prefix Sum, Binary Search, Mono Stack, Mono Deque, Two Pointers
2969 | [Minimum Number of Coins for Fruits II](https://leetcode.com/problems/minimum-number-of-coins-for-fruits-ii/) | [C++](./C++/minimum-number-of-coins-for-fruits-ii.cpp) [Python](./Python/minimum-number-of-coins-for-fruits-ii.py) | _O(n)_ | _O(n)_ | Hard | š | DP, Sorted List, BST, Mono Deque
2976 | [Minimum Cost to Convert String I](https://leetcode.com/problems/minimum-cost-to-convert-string-i/) | [C++](./C++/minimum-cost-to-convert-string-i.cpp) [Python](./Python/minimum-cost-to-convert-string-i.py) | _O(o + k * eloge + n)_ | _O(o + k * v)_ | Medium | | `Dijkstra's Algorithm`, `Floyd-Warshall Algorithm`, DP, Memoization
2977 | [Minimum Cost to Convert String II](https://leetcode.com/problems/minimum-cost-to-convert-string-ii/) | [C++](./C++/minimum-cost-to-convert-string-ii.cpp) [Python](./Python/minimum-cost-to-convert-string-ii.py) | _O(o * l + k * eloge + n * l)_ | _O(t + k * v + l)_ | Hard | | `Dijkstra's Algorithm`, `Floyd-Warshall Algorithm`, DP, Memoization, Trie
2992 | [Number of Self-Divisible Permutations](https://leetcode.com/problems/number-of-self-divisible-permutations/) | [C++](./C++/number-of-self-divisible-permutations.cpp) [Python](./Python/number-of-self-divisible-permutations.py) | _O(n * 2^n)_ | _O(2^n)_ | Medium | š | Bitmasks, DP
2998 | [Minimum Number of Operations to Make X and Y Equal](https://leetcode.com/problems/minimum-number-of-operations-to-make-x-and-y-equal/) | [C++](./C++/minimum-number-of-operations-to-make-x-and-y-equal.cpp) [Python](./Python/minimum-number-of-operations-to-make-x-and-y-equal.py) | _O(x)_ | _O(x)_ | Medium | | Memoization, BFS
3018 | [Maximum Number of Removal Queries That Can Be Processed I](https://leetcode.com/problems/maximum-number-of-removal-queries-that-can-be-processed-i/) | [C++](./C++/maximum-number-of-removal-queries-that-can-be-processed-i.cpp) [Python](./Python/maximum-number-of-removal-queries-that-can-be-processed-i.py) | _O(n^2)_ | _O(n^2)_ | Hard | š | DP
3020 | [Find the Maximum Number of Elements in Subset](https://leetcode.com/problems/find-the-maximum-number-of-elements-in-subset/) | [C++](./C++/find-the-maximum-number-of-elements-in-subset.cpp) [Python](./Python/find-the-maximum-number-of-elements-in-subset.py) | _O(n)_ | _O(n)_ | Medium || Freq Table, DP
3040 | [Maximum Number of Operations With the Same Score II](https://leetcode.com/problems/maximum-number-of-operations-with-the-same-score-ii/) | [C++](./C++/maximum-number-of-operations-with-the-same-score-ii.cpp) [Python](./Python/maximum-number-of-operations-with-the-same-score-ii.py) | _O(n^2)_ | _O(n^2)_ | Medium | | Memoization
3041 | [Maximize Consecutive Elements in an Array After Modification](https://leetcode.com/problems/maximize-consecutive-elements-in-an-array-after-modification/) | [C++](./C++/maximize-consecutive-elements-in-an-array-after-modification.cpp) [Python](./Python/maximize-consecutive-elements-in-an-array-after-modification.py) | _O(nlogn)_ | _O(1)_ | Hard | | Sort, DP
3077 | [Maximum Strength of K Disjoint Subarrays](https://leetcode.com/problems/maximum-strength-of-k-disjoint-subarrays/) | [C++](./C++/maximum-strength-of-k-disjoint-subarrays.cpp) [Python](./Python/maximum-strength-of-k-disjoint-subarrays.py) | _O(k * n)_ | _O(n)_ | Hard | | DP, Greedy, `Kadane's Algorithm`
3082 | [Find the Sum of the Power of All Subsequences](https://leetcode.com/problems/find-the-sum-of-the-power-of-all-subsequences/) | [C++](./C++/find-the-sum-of-the-power-of-all-subsequences.cpp) [Python](./Python/find-the-sum-of-the-power-of-all-subsequences.py) | _O(n * k)_ | _O(k)_ | Hard | | DP, Combinatorics
3098 | [Find the Sum of Subsequence Powers](https://leetcode.com/problems/find-the-sum-of-subsequence-powers/) | [C++](./C++/find-the-sum-of-subsequence-powers.cpp) [Python](./Python/find-the-sum-of-subsequence-powers.py) | _O(n^3 * k)_ | _O(n^2)_ | Hard | | DP, Prefix Sum, Two Pointers
3101 | [Count Alternating Subarrays](https://leetcode.com/problems/count-alternating-subarrays/) | [C++](./C++/count-alternating-subarrays.cpp) [Python](./Python/count-alternating-subarrays.py) | _O(n)_ | _O(1)_ | Medium | | DP
3117 | [Minimum Sum of Values by Dividing Array](https://leetcode.com/problems/minimum-sum-of-values-by-dividing-array/) | [C++](./C++/minimum-sum-of-values-by-dividing-array.cpp) [Python](./Python/minimum-sum-of-values-by-dividing-array.py) | _O(n * m * logr)_ | _O(n + logr)_ | Hard | | Memoization, DP, RMQ, Sparse Table, Mono Deque, Two Pointers
3122 | [Minimum Number of Operations to Satisfy Conditions](https://leetcode.com/problems/minimum-number-of-operations-to-satisfy-conditions/) | [C++](./C++/minimum-number-of-operations-to-satisfy-conditions.cpp) [Python](./Python/minimum-number-of-operations-to-satisfy-conditions.py) | _O(n * (m + 10))_ | _O(10)_ | Medium | | DP
3129 | [Find All Possible Stable Binary Arrays I](https://leetcode.com/problems/find-all-possible-stable-binary-arrays-i/) | [C++](./C++/find-all-possible-stable-binary-arrays-i.cpp) [Python](./Python/find-all-possible-stable-binary-arrays-i.py) | _O(n * m)_ | _O(n * m)_ | Medium | | DP
3130 | [Find All Possible Stable Binary Arrays II](https://leetcode.com/problems/find-all-possible-stable-binary-arrays-ii/) | [C++](./C++/find-all-possible-stable-binary-arrays-ii.cpp) [Python](./Python/find-all-possible-stable-binary-arrays-ii.py) | _O(n * m)_ | _O(n * m)_ | Hard | | DP
3141 | [Maximum Hamming Distances](https://leetcode.com/problems/maximum-hamming-distances/)| [C++](./C++/maximum-hamming-distances.cpp) [Python](./Python/maximum-hamming-distances.py)| _O(m * 2^m)_ | _O(2^m)_ | Hard | š | Bitmasks, BFS, Knapsack DP |
3144 | [Minimum Substring Partition of Equal Character Frequency](https://leetcode.com/problems/minimum-substring-partition-of-equal-character-frequency/) | [C++](./C++/minimum-substring-partition-of-equal-character-frequency.cpp) [Python](./Python/minimum-substring-partition-of-equal-character-frequency.py) | _O(n * (n + 26))_ | _O(n + 26)_ | Medium | | DP, Freq Table
3148 | [Maximum Difference Score in a Grid](https://leetcode.com/problems/maximum-difference-score-in-a-grid/) | [C++](./C++/maximum-difference-score-in-a-grid.cpp) [Python](./Python/maximum-difference-score-in-a-grid.py) | _O(m * n)_ | _O(1)_ | Medium | | DP
3149 | [Find the Minimum Cost Array Permutation](https://leetcode.com/problems/find-the-minimum-cost-array-permutation/) | [C++](./C++/find-the-minimum-cost-array-permutation.cpp) [Python](./Python/find-the-minimum-cost-array-permutation.py) | _O((n-1)^2 * 2^(n-1))_ | _O((n-1) * 2^(n-1))_ | Hard | | DP, Backtracing
3176 | [Find the Maximum Length of a Good Subsequence I](https://leetcode.com/problems/find-the-maximum-length-of-a-good-subsequence-i/) | [C++](./C++/find-the-maximum-length-of-a-good-subsequence-i.cpp) [Python](./Python/find-the-maximum-length-of-a-good-subsequence-i.py) | _O(n * k)_ | _O(n * k)_ | Medium | | DP
3177 | [Find the Maximum Length of a Good Subsequence II](https://leetcode.com/problems/find-the-maximum-length-of-a-good-subsequence-ii/) | [C++](./C++/find-the-maximum-length-of-a-good-subsequence-ii.cpp) [Python](./Python/find-the-maximum-length-of-a-good-subsequence-ii.py) | _O(n * k)_ | _O(n * k)_ | Hard | | DP
3180 | [Maximum Total Reward Using Operations I](https://leetcode.com/problems/maximum-total-reward-using-operations-i/) | [C++](./C++/maximum-total-reward-using-operations-i.cpp) [Python](./Python/maximum-total-reward-using-operations-i.py) | _O(n * k)_ | _O(n * k)_ | Medium | | Sort, DP, Bitset
3181 | [Maximum Total Reward Using Operations II](https://leetcode.com/problems/maximum-total-reward-using-operations-ii/) | [C++](./C++/maximum-total-reward-using-operations-ii.cpp) [Python](./Python/maximum-total-reward-using-operations-ii.py) | _O(n * k)_ | _O(n * k)_ | Hard | | Sort, DP, Bitset
3186 | [Maximum Total Damage With Spell Casting](https://leetcode.com/problems/maximum-total-damage-with-spell-casting/) | [C++](./C++/maximum-total-damage-with-spell-casting.cpp) [Python](./Python/maximum-total-damage-with-spell-casting.py) | _O(nlogn)_ | _O(n)_ | Medium | | Sort, DP, Two Pointers, Sliding window, Deque
3193 | [Count the Number of Inversions](https://leetcode.com/problems/count-the-number-of-inversions/) | [C++](./C++/count-the-number-of-inversions.cpp) [Python](./Python/count-the-number-of-inversions.py) | _O(n * k)_ | _O(n + k)_ | Hard | variant of [K Inverse Pairs Array](https://leetcode.com/problems/k-inverse-pairs-array/) | Knapsack DP, Combinatorics, Sliding Window, Two Pointers
3196 | [Maximize Total Cost of Alternating Subarrays](https://leetcode.com/problems/maximize-total-cost-of-alternating-subarrays/) | [C++](./C++/maximize-total-cost-of-alternating-subarrays.cpp) [Python](./Python/maximize-total-cost-of-alternating-subarrays.py) | _O(n)_ | _O(1)_ | Medium | | DP
3197 | [Find the Minimum Area to Cover All Ones II](https://leetcode.com/problems/find-the-minimum-area-to-cover-all-ones-ii/) | [C++](./C++/find-the-minimum-area-to-cover-all-ones-ii.cpp) [Python](./Python/find-the-minimum-area-to-cover-all-ones-ii.py) | _O(max(n, m)^2)_ | _O(max(n, m)^2)_ | Hard | | Array, Brute Force, Prefix Sum, Binary Search, RMQ, Sparse Table, DP
3201 | [Find the Maximum Length of Valid Subsequence I](https://leetcode.com/problems/find-the-maximum-length-of-valid-subsequence-i/) | [C++](./C++/find-the-maximum-length-of-valid-subsequence-i.cpp) [Python](./Python/find-the-maximum-length-of-valid-subsequence-i.py) | _O(n)_ | _O(1)_ | Medium | | Brute Force, DP
3202 | [Find the Maximum Length of Valid Subsequence II](https://leetcode.com/problems/find-the-maximum-length-of-valid-subsequence-ii/) | [C++](./C++/find-the-maximum-length-of-valid-subsequence-ii.cpp) [Python](./Python/find-the-maximum-length-of-valid-subsequence-ii.py) | _O(n * k)_ | _O(k)_ | Medium | | DP
3209 | [Number of Subarrays With AND Value of K](https://leetcode.com/problems/number-of-subarrays-with-and-value-of-k/)| [C++](./C++/number-of-subarrays-with-and-value-of-k.cpp) [Python](./Python/number-of-subarrays-with-and-value-of-k.py) | _O(nlogr)_ | _O(logr)_ | Hard | variant of [Find Subarray With Bitwise OR Closest to K](https://leetcode.com/problems/find-subarray-with-bitwise-or-closest-to-k/) | DP
3212 | [Count Submatrices With Equal Frequency of X and Y](https://leetcode.com/problems/count-submatrices-with-equal-frequency-of-x-and-y/) | [C++](./C++/count-submatrices-with-equal-frequency-of-x-and-y.cpp) [Python](./Python/count-submatrices-with-equal-frequency-of-x-and-y.py) | _O(n * m)_ | _O(n * m)_ | Medium | | DP
3213 | [Construct String with Minimum Cost](https://leetcode.com/problems/construct-string-with-minimum-cost/) | [C++](./C++/construct-string-with-minimum-cost.cpp) [Python](./Python/construct-string-with-minimum-cost.py) | _O(n^2 + w * l)_ | _O(t)_ | Hard | | DP, Trie
3225 | [Maximum Score From Grid Operations](https://leetcode.com/problems/maximum-score-from-grid-operations/) | [C++](./C++/maximum-score-from-grid-operations.cpp) [Python](./Python/maximum-score-from-grid-operations.py) | _O(n^3)_ | _O(n)_ | Hard | | Prefix Sum, DP
3241 | [Time Taken to Mark All Nodes](https://leetcode.com/problems/time-taken-to-mark-all-nodes/) | [C++](./C++/time-taken-to-mark-all-nodes.cpp) [Python](./Python/time-taken-to-mark-all-nodes.py) | _O(n)_ | _O(n)_ | Hard | | Tree DP, BFS, DFS
3253 | [Construct String with Minimum Cost (Easy)](https://leetcode.com/problems/construct-string-with-minimum-cost-easy/) | [C++](./C++/construct-string-with-minimum-cost-easy.cpp) [Python](./Python/construct-string-with-minimum-cost-easy.py) | _O(n * w * l)_ | _O(l)_ | Medium | š | DP, Trie
3259 | [Maximum Energy Boost From Two Drinks](https://leetcode.com/problems/maximum-energy-boost-from-two-drinks/) | [C++](./C++/maximum-energy-boost-from-two-drinks.cpp) [Python](./Python/maximum-energy-boost-from-two-drinks.py) | _O(n)_ | _O(1)_ | Medium | | DP
3269 | [Constructing Two Increasing Arrays](https://leetcode.com/problems/constructing-two-increasing-arrays/) | [C++](./C++/constructing-two-increasing-arrays.cpp) [Python](./Python/constructing-two-increasing-arrays.py) | _O(m * n)_ | _O(min(m, n))_ | Hard | š | DP
3277 | [Maximum XOR Score Subarray Queries](https://leetcode.com/problems/maximum-xor-score-subarray-queries/) | [C++](./C++/maximum-xor-score-subarray-queries.cpp) [Python](./Python/maximum-xor-score-subarray-queries.py) | _O(n^2 + q)_ | _O(n^2)_ | Hard | | DP
3283 | [Maximum Number of Moves to Kill All Pawns](https://leetcode.com/problems/maximum-number-of-moves-to-kill-all-pawns/) | [C++](./C++/maximum-number-of-moves-to-kill-all-pawns.cpp) [Python](./Python/maximum-number-of-moves-to-kill-all-pawns.py) | _O(p^2 * 2^p)_ | _O(p * 2^p)_ | Hard | | BFS, Bitmasks, DP
3287 | [Find the Maximum Sequence Value of Array](https://leetcode.com/problems/find-the-maximum-sequence-value-of-array/) | [C++](./C++/find-the-maximum-sequence-value-of-array.cpp) [Python](./Python/find-the-maximum-sequence-value-of-array.py) | _O(n * r + r^2)_ | _O(r)_ | Hard | | Bitmasks, Prefix Sum, DP
3290 | [Maximum Multiplication Score](https://leetcode.com/problems/maximum-multiplication-score/) | [C++](./C++/maximum-multiplication-score.cpp) [Python](./Python/maximum-multiplication-score.py) | _O(n)_ | _O(1)_ | Medium | | DP
3291 | [Minimum Number of Valid Strings to Form Target I](https://leetcode.com/problems/minimum-number-of-valid-strings-to-form-target-i/)| [C++](./C++/minimum-number-of-valid-strings-to-form-target-i.cpp) [Python](./Python/minimum-number-of-valid-strings-to-form-target-i.py) | _O(n + w * l)_ | _O(n + t)_ | Medium | | KMP, `Rabin-Karp Algorithm`, Rolling Hash, Hash Table, Two Pointers, Sliding Window, DP, `Aho-Corasick Automata`, Trie
3292 | [Minimum Number of Valid Strings to Form Target II](https://leetcode.com/problems/minimum-number-of-valid-strings-to-form-target-ii/)| [C++](./C++/minimum-number-of-valid-strings-to-form-target-ii.cpp) [Python](./Python/minimum-number-of-valid-strings-to-form-target-ii.py) | _O(n + w * l)_ | _O(n + t)_ | Hard | | KMP, `Rabin-Karp Algorithm`, Rolling Hash, Hash Table, Two Pointers, Sliding Window, DP, `Aho-Corasick Automata`, Trie
3313 | [Find the Last Marked Nodes in Tree](https://leetcode.com/problems/find-the-last-marked-nodes-in-tree/) | [C++](./C++/find-the-last-marked-nodes-in-tree.cpp) [Python](./Python/find-the-last-marked-nodes-in-tree.py) | _O(n)_ | _O(n)_ | Hard | š, variant of [Time Taken to Mark All Nodes](https://leetcode.com/problems/time-taken-to-mark-all-nodes/) | BFS, DFS, Tree DP, Tree Diameter
3316 | [Find Maximum Removals From Source String](https://leetcode.com/problems/find-maximum-removals-from-source-string/) | [C++](./C++/find-maximum-removals-from-source-string.cpp) [Python](./Python/find-maximum-removals-from-source-string.py) | _O(n * m)_ | _O(n + m)_ | Medium | | DP
3320 | [Count The Number of Winning Sequences](https://leetcode.com/problems/count-the-number-of-winning-sequences/) | [C++](./C++/count-the-number-of-winning-sequences.cpp) [Python](./Python/count-the-number-of-winning-sequences.py) | _O(n^2)_ | _O(n)_ | Hard | | DP
3332 | [Maximum Points Tourist Can Earn](https://leetcode.com/problems/maximum-points-tourist-can-earn/) | [C++](./C++/maximum-points-tourist-can-earn.cpp) [Python](./Python/maximum-points-tourist-can-earn.py) | _O(k * n^2)_ | _O(n)_ | Hard | | DP
3333 | [Find the Original Typed String II](https://leetcode.com/problems/find-the-original-typed-string-ii/) | [C++](./C++/find-the-original-typed-string-ii.cpp) [Python](./Python/find-the-original-typed-string-ii.py) | _O(n + k^2)_ | _O(n + k)_ | Hard | | DP
3335 | [Total Characters in String After Transformations I](https://leetcode.com/problems/total-characters-in-string-after-transformations-i/) | [C++](./C++/total-characters-in-string-after-transformations-i.cpp) [Python](./Python/total-characters-in-string-after-transformations-i.py) | precompute: _O(t + 26)_ <br>runtime: _O(n)_ | _O(t + 26)_ | Medium | | DP, Matrix Exponentiation, Precompute
3336 | [Find the Number of Subsequences With Equal GCD](https://leetcode.com/problems/find-the-number-of-subsequences-with-equal-gcd/) | [C++](./C++/find-the-number-of-subsequences-with-equal-gcd.cpp) [Python](./Python/find-the-number-of-subsequences-with-equal-gcd.py) | precompute: _O(max_r^2 * log(max_r))_ <br> runtime: O(n + r^2) | _O(max_r^2)_ | Hard | | DP, Number Theory, Mobius Function, Principle of Inclusion-Exclusion, `Basel Problem`
3337 | [Total Characters in String After Transformations II](https://leetcode.com/problems/total-characters-in-string-after-transformations-ii/) | [C++](./C++/total-characters-in-string-after-transformations-ii.cpp) [Python](./Python/total-characters-in-string-after-transformations-ii.py) | _O(n + 26^3 * logt)_ | _O(26^2)_ | Hard | | DP, Matrix Exponentiation
3343 | [Count Number of Balanced Permutations](https://leetcode.com/problems/count-number-of-balanced-permutations/) | [C++](./C++/count-number-of-balanced-permutations.cpp) [Python](./Python/count-number-of-balanced-permutations.py) | _O(n^2)_ | _O(n^2)_ | Hard | | DP, Combinatorics
3351 | [Sum of Good Subsequences](https://leetcode.com/problems/sum-of-good-subsequences/) | [C++](./C++/sum-of-good-subsequences.cpp) [Python](./Python/sum-of-good-subsequences.py) | _O(n)_ | _O(n)_ | Hard | | Freq Table, DP
3352 | [Count K-Reducible Numbers Less Than N](https://leetcode.com/problems/count-k-reducible-numbers-less-than-n/) | [C++](./C++/count-k-reducible-numbers-less-than-n.cpp) [Python](./Python/count-k-reducible-numbers-less-than-n.py) | _O(n^2)_ | _O(n)_ | Hard | | DP, Combinatorics
3359 | [Find Sorted Submatrices With Maximum Element at Most K](https://leetcode.com/problems/find-sorted-submatrices-with-maximum-element-at-most-k/) | [C++](./C++/find-sorted-submatrices-with-maximum-element-at-most-k.cpp) [Python](./Python/find-sorted-submatrices-with-maximum-element-at-most-k.py) | _O(m * n)_ | _O(m)_ | Hard | š, variant of [Count Submatrices With All Ones](https://leetcode.com/problems/count-submatrices-with-all-ones/) | Mono Stack, DP
3363 | [Find the Maximum Number of Fruits Collected](https://leetcode.com/problems/find-the-maximum-number-of-fruits-collected/) | [C++](./C++/find-the-maximum-number-of-fruits-collected.cpp) [Python](./Python/find-the-maximum-number-of-fruits-collected.py) | _O(n^2)_ | _O(1)_ | Hard | | DP
3366 | [Minimum Array Sum](https://leetcode.com/problems/minimum-array-sum/) | [C++](./C++/minimum-array-sum.cpp) [Python](./Python/minimum-array-sum.py) | _O(nlogn)_ | _O(n)_ | Medium | | DP, Greedy, Case Works
3372 | [Maximize the Number of Target Nodes After Connecting Trees I](https://leetcode.com/problems/maximize-the-number-of-target-nodes-after-connecting-trees-i/) | [C++](./C++/maximize-the-number-of-target-nodes-after-connecting-trees-i.cpp) [Python](./Python/maximize-the-number-of-target-nodes-after-connecting-trees-i.py) | _O(nlogn + mlogm)_ | _O(n + m)_ | Medium | | Brute Force, BFS, DFS, Tree DP, Centroid Decomposition, Prefix Sum
3381 | [Maximum Subarray Sum With Length Divisible by K](https://leetcode.com/problems/maximum-subarray-sum-with-length-divisible-by-k/) | [C++](./C++/maximum-subarray-sum-with-length-divisible-by-k.cpp) [Python](./Python/maximum-subarray-sum-with-length-divisible-by-k.py) | _O(n)_ | _O(k)_ | Medium | | Prefix Sum, DP
3388 | [Count Beautiful Splits in an Array](https://leetcode.com/problems/count-beautiful-splits-in-an-array/) | [C++](./C++/count-beautiful-splits-in-an-array.cpp) [Python](./Python/count-beautiful-splits-in-an-array.py) | _O(n^2)_ | _O(n)_ | Medium | | DP, `Z-Function`
3389 | [Minimum Operations to Make Character Frequencies Equal](https://leetcode.com/problems/minimum-operations-to-make-character-frequencies-equal/) | [C++](./C++/minimum-operations-to-make-character-frequencies-equal.cpp) [Python](./Python/minimum-operations-to-make-character-frequencies-equal.py) | _O(26 * n)_ | _O(26)_ | Hard | | Freq Table, DP
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Greedy
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2027 | [Minimum Moves to Convert String](https://leetcode.com/problems/minimum-moves-to-convert-string/) | [C++](./C++/minimum-moves-to-convert-string.cpp) [Python](./Python/minimum-moves-to-convert-string.py) | _O(n)_ | _O(1)_ | Easy | | |
2030 | [Smallest K-Length Subsequence With Occurrences of a Letter](https://leetcode.com/problems/smallest-k-length-subsequence-with-occurrences-of-a-letter/) | [C++](./C++/smallest-k-length-subsequence-with-occurrences-of-a-letter.cpp) [Python](./Python/smallest-k-length-subsequence-with-occurrences-of-a-letter.py) | _O(n)_ | _O(n)_ | Hard | | Mono Stack, Greedy
2036 | [Maximum Alternating Subarray Sum](https://leetcode.com/problems/maximum-alternating-subarray-sum/) | [C++](./C++/maximum-alternating-subarray-sum.cpp) [Python](./Python/maximum-alternating-subarray-sum.py) | _O(n)_ | _O(1)_ | Medium | variant of [Maximum Alternating Subsequence Sum](https://leetcode.com/problems/maximum-alternating-subsequence-sum/), š | Greedy, `Kadane's Algorithm`
2037 | [Minimum Number of Moves to Seat Everyone](https://leetcode.com/problems/minimum-number-of-moves-to-seat-everyone/) | [C++](./C++/minimum-number-of-moves-to-seat-everyone.cpp) [Python](./Python/minimum-number-of-moves-to-seat-everyone.py) | _O(nlogn)_ | _O(1)_ | Easy | | Greedy|
2071 | [Maximum Number of Tasks You Can Assign](https://leetcode.com/problems/maximum-number-of-tasks-you-can-assign/) | [C++](./C++/maximum-number-of-tasks-you-can-assign.cpp) [Python](./Python/maximum-number-of-tasks-you-can-assign.py) | _O(n * (logn)^2)_ | _O(n)_ | Hard | | Greedy, Binary Search, Sorted List |
2086 | [Minimum Number of Buckets Required to Collect Rainwater from Houses](https://leetcode.com/problems/minimum-number-of-buckets-required-to-collect-rainwater-from-houses/) | [C++](./C++/minimum-number-of-buckets-required-to-collect-rainwater-from-houses.cpp) [Python](./Python/minimum-number-of-buckets-required-to-collect-rainwater-from-houses.py) | _O(n)_ | _O(1)_ | Medium | | Greedy |
2087 | [Minimum Cost Homecoming of a Robot in a Grid](https://leetcode.com/problems/minimum-cost-homecoming-of-a-robot-in-a-grid/) | [C++](./C++/minimum-cost-homecoming-of-a-robot-in-a-grid.cpp) [Python](./Python/minimum-cost-homecoming-of-a-robot-in-a-grid.py) | _O(m + n)_ | _O(1)_ | Medium | | Greedy |
2126 | [Destroying Asteroids](https://leetcode.com/problems/destroying-asteroids/) | [C++](./C++/destroying-asteroids.cpp) [Python](./Python/destroying-asteroids.py) | _O(nlogn)_ | _O(1)_ | Medium | | Greedy |
2136 | [Earliest Possible Day of Full Bloom](https://leetcode.com/problems/earliest-possible-day-of-full-bloom/) | [C++](./C++/earliest-possible-day-of-full-bloom.cpp) [Python](./Python/earliest-possible-day-of-full-bloom.py) | _O(nlogn)_ | _O(n)_ | Hard | | Greedy |
2139 | [Minimum Moves to Reach Target Score](https://leetcode.com/problems/minimum-moves-to-reach-target-score/) | [C++](./C++/minimum-moves-to-reach-target-score.cpp) [Python](./Python/minimum-moves-to-reach-target-score.py) | _O(logn)_ | _O(1)_ | Medium | | |
2141 | [Maximum Running Time of N Computers](https://leetcode.com/problems/maximum-running-time-of-n-computers/) | [C++](./C++/maximum-running-time-of-n-computers.cpp) [Python](./Python/maximum-running-time-of-n-computers.py) | _O(nlogm)_ | _O(1)_ | Hard | | Greedy, Binary Search |
2144 | [Minimum Cost of Buying Candies With Discount](https://leetcode.com/problems/minimum-cost-of-buying-candies-with-discount/) | [C++](./C++/minimum-cost-of-buying-candies-with-discount.cpp) [Python](./Python/minimum-cost-of-buying-candies-with-discount.py) | _O(nlogn)_ | _O(1)_ | Easy | | Greedy, Sort |
2147 | [Number of Ways to Divide a Long Corridor](https://leetcode.com/problems/number-of-ways-to-divide-a-long-corridor/) | [C++](./C++/number-of-ways-to-divide-a-long-corridor.cpp) [Python](./Python/number-of-ways-to-divide-a-long-corridor.py) | _O(n)_ | _O(1)_ | Hard | | Greedy, Combinatorics |
2160 | [Minimum Sum of Four Digit Number After Splitting Digits](https://leetcode.com/problems/minimum-sum-of-four-digit-number-after-splitting-digits/) | [C++](./C++/minimum-sum-of-four-digit-number-after-splitting-digits.cpp) [Python](./Python/minimum-sum-of-four-digit-number-after-splitting-digits.py) | _O(1)_ | _O(1)_ | Easy | | Greedy |
2165 | [Smallest Value of the Rearranged Number](https://leetcode.com/problems/smallest-value-of-the-rearranged-number/) | [C++](./C++/smallest-value-of-the-rearranged-number.cpp) [Python](./Python/smallest-value-of-the-rearranged-number.py) | _O(d)_ | _O(d)_ | Medium | | Greedy, Counting Sort |
2178 | [Maximum Split of Positive Even Integers](https://leetcode.com/problems/maximum-split-of-positive-even-integers/) | [C++](./C++/maximum-split-of-positive-even-integers.cpp) [Python](./Python/maximum-split-of-positive-even-integers.py) | _O(sqrt(n))_ | _O(1)_ | Medium | | Greedy |
2182 | [Construct String With Repeat Limit](https://leetcode.com/problems/construct-string-with-repeat-limit/) | [C++](./C++/construct-string-with-repeat-limit.cpp) [Python](./Python/construct-string-with-repeat-limit.py) | _O(n)_ | _O(1)_ | Medium | | Greedy |
2193 | [Minimum Number of Moves to Make Palindrome](https://leetcode.com/problems/minimum-number-of-moves-to-make-palindrome/) | [C++](./C++/minimum-number-of-moves-to-make-palindrome.cpp) [Python](./Python/minimum-number-of-moves-to-make-palindrome.py) | _O(nlogn)_ | _O(n)_ | Hard | | Greedy, BIT, Fenwick Tree |
2195 | [Append K Integers With Minimal Sum](https://leetcode.com/problems/append-k-integers-with-minimal-sum/) | [C++](./C++/append-k-integers-with-minimal-sum.cpp) [Python](./Python/append-k-integers-with-minimal-sum.py) | _O(nlogn)_ | _O(n)_ | Medium | | Greedy |
2207 | [Maximize Number of Subsequences in a String](https://leetcode.com/problems/maximize-number-of-subsequences-in-a-string/) | [C++](./C++/maximize-number-of-subsequences-in-a-string.cpp) [Python](./Python/maximize-number-of-subsequences-in-a-string.py) | _O(n)_ | _O(1)_ | Medium | | Counting, Greedy |
2214 | [Minimum Health to Beat Game](https://leetcode.com/problems/minimum-health-to-beat-game/) | [C++](./C++/minimum-health-to-beat-game.cpp) [Python](./Python/minimum-health-to-beat-game.py) | _O(n)_ | _O(1)_ | Medium | š | Greedy |
2216 | [Minimum Deletions to Make Array Beautiful](https://leetcode.com/problems/minimum-deletions-to-make-array-beautiful/) | [C++](./C++/minimum-deletions-to-make-array-beautiful.cpp) [Python](./Python/minimum-deletions-to-make-array-beautiful.py) | _O(n)_ | _O(1)_ | Medium | | Greedy |
2224 | [Minimum Number of Operations to Convert Time](https://leetcode.com/problems/minimum-number-of-operations-to-convert-time/) | [C++](./C++/minimum-number-of-operations-to-convert-time.cpp) [Python](./Python/minimum-number-of-operations-to-convert-time.py) | _O(1)_ | _O(1)_ | Easy | | Greedy |
2259 | [Remove Digit From Number to Maximize Result](https://leetcode.com/problems/remove-digit-from-number-to-maximize-result/) | [C++](./C++/remove-digit-from-number-to-maximize-result.cpp) [Python](./Python/remove-digit-from-number-to-maximize-result.py) | _O(n)_ | _O(1)_ | Easy | | Greedy |
2263 | [Make Array Non-decreasing or Non-increasing](https://leetcode.com/problems/make-array-non-decreasing-or-non-increasing/) | [C++](./C++/make-array-non-decreasing-or-non-increasing.cpp) [Python](./Python/make-array-non-decreasing-or-non-increasing.py) | _O(nlogn)_ | _O(n)_ | Hard | š | DP, Greedy, Heap |
2268 | [Minimum Number of Keypresses](https://leetcode.com/problems/minimum-number-of-keypresses/) | [C++](./C++/minimum-number-of-keypresses.cpp) [Python](./Python/minimum-number-of-keypresses.py) | _O(n)_ | _O(1)_ | Medium | š | Greedy, Sort |
2279 | [Maximum Bags With Full Capacity of Rocks](https://leetcode.com/problems/maximum-bags-with-full-capacity-of-rocks/) | [C++](./C++/maximum-bags-with-full-capacity-of-rocks.cpp) [Python](./Python/maximum-bags-with-full-capacity-of-rocks.py) | _O(nlogn)_ | _O(1)_ | Medium | | Greedy, Sort |
2285 | [Maximum Total Importance of Roads](https://leetcode.com/problems/maximum-total-importance-of-roads/) | [C++](./C++/maximum-total-importance-of-roads.cpp) [Python](./Python/maximum-total-importance-of-roads.py) | _O(n)_ | _O(n)_ | Medium | | Greedy, Counting Sort |
2294 | [Partition Array Such That Maximum Difference Is K](https://leetcode.com/problems/partition-array-such-that-maximum-difference-is-k/) | [C++](./C++/partition-array-such-that-maximum-difference-is-k.cpp) [Python](./Python/partition-array-such-that-maximum-difference-is-k.py) | _O(nlogn)_ | _O(1)_ | Medium | | Greedy |
2311 | [Longest Binary Subsequence Less Than or Equal to K](https://leetcode.com/problems/longest-binary-subsequence-less-than-or-equal-to-k/) | [C++](./C++/longest-binary-subsequence-less-than-or-equal-to-k.cpp) [Python](./Python/longest-binary-subsequence-less-than-or-equal-to-k.py) | _O(n)_ | _O(1)_ | Medium | | Greedy |
2321 | [Maximum Score Of Spliced Array](https://leetcode.com/problems/maximum-score-of-spliced-array/) | [C++](./C++/maximum-score-of-spliced-array.cpp) [Python](./Python/maximum-score-of-spliced-array.py) | _O(n)_ | _O(1)_ | Hard | | Greedy, `Kadane's Algorithm`
2323 | [Find Minimum Time to Finish All Jobs II](https://leetcode.com/problems/find-minimum-time-to-finish-all-jobs-ii/) | [C++](./C++/find-minimum-time-to-finish-all-jobs-ii.cpp) [Python](./Python/find-minimum-time-to-finish-all-jobs-ii.py) | _O(nlogn)_ | _O(1)_ | Medium | š | Greedy
2340 | [Minimum Adjacent Swaps to Make a Valid Array](https://leetcode.com/problems/minimum-adjacent-swaps-to-make-a-valid-array/) | [C++](./C++/minimum-adjacent-swaps-to-make-a-valid-array.cpp) [Python](./Python/minimum-adjacent-swaps-to-make-a-valid-array.py) | _O(n)_ | _O(1)_ | Medium | š | Array, Greedy
2366 | [Minimum Replacements to Sort the Array](https://leetcode.com/problems/minimum-replacements-to-sort-the-array/) | [C++](./C++/minimum-replacements-to-sort-the-array.cpp) [Python](./Python/minimum-replacements-to-sort-the-array.py) | _O(n)_ | _O(1)_ | Hard | | Greedy, Math
2371 | [Minimize Maximum Value in a Grid](https://leetcode.com/problems/minimize-maximum-value-in-a-grid/) | [C++](./C++/minimize-maximum-value-in-a-grid.cpp) [Python](./Python/minimize-maximum-value-in-a-grid.py) | _O((m * n) * log(m * n))_ | _O(m * n)_ | Hard | š | Sort, Greedy
2375 | [Construct Smallest Number From DI String](https://leetcode.com/problems/construct-smallest-number-from-di-string/) | [C++](./C++/construct-smallest-number-from-di-string.cpp) [Python](./Python/construct-smallest-number-from-di-string.py) | _O(n)_ | _O(1)_ | Medium | | Constructive Algorithms, Greedy
2383 | [Minimum Hours of Training to Win a Competition](https://leetcode.com/problems/minimum-hours-of-training-to-win-a-competition/) | [C++](./C++/minimum-hours-of-training-to-win-a-competition.cpp) [Python](./Python/minimum-hours-of-training-to-win-a-competition.py) | _O(n)_ | _O(1)_ | Easy | | Greedy
2384 | [Largest Palindromic Number](https://leetcode.com/problems/largest-palindromic-number/) | [C++](./C++/largest-palindromic-number.cpp) [Python](./Python/largest-palindromic-number.py) | _O(n)_ | _O(1)_ | Medium | | Freq Table, Greedy
2405 | [Optimal Partition of String](https://leetcode.com/problems/optimal-partition-of-string/) | [C++](./C++/optimal-partition-of-string.cpp) [Python](./Python/optimal-partition-of-string.py) | _O(n)_ | _O(n)_ | Medium || Greedy, Hash Table
2410 | [Maximum Matching of Players With Trainers](https://leetcode.com/problems/maximum-matching-of-players-with-trainers/) | [C++](./C++/maximum-matching-of-players-with-trainers.cpp) [Python](./Python/maximum-matching-of-players-with-trainers.py) | _O(nlogn + mlogm)_ | _O(1)_ | Medium || Greedy, Sort
2412 | [Minimum Money Required Before Transactions](https://leetcode.com/problems/minimum-money-required-before-transactions/) | [C++](./C++/minimum-money-required-before-transactions.cpp) [Python](./Python/minimum-money-required-before-transactions.py) | _O(n)_ | _O(1)_ | Hard || Greedy, Constructive Algorithms
2417 | [Closest Fair Integer](https://leetcode.com/problems/closest-fair-integer/) | [C++](./C++/closest-fair-integer.cpp) [Python](./Python/closest-fair-integer.py) | _O(logn)_ | _O(logn)_ | Medium | š | Constructive Algorithms, Greedy
2422 | [Merge Operations to Turn Array Into a Palindrome](https://leetcode.com/problems/merge-operations-to-turn-array-into-a-palindrome/) | [C++](./C++/merge-operations-to-turn-array-into-a-palindrome.cpp) [Python](./Python/merge-operations-to-turn-array-into-a-palindrome.py) | _O(n)_ | _O(1)_ | Medium | š | Constructive Algorithms, Greedy, Two Pointers
2434 | [Using a Robot to Print the Lexicographically Smallest String](https://leetcode.com/problems/using-a-robot-to-print-the-lexicographically-smallest-string/) | [C++](./C++/using-a-robot-to-print-the-lexicographically-smallest-string.cpp) [Python](./Python/using-a-robot-to-print-the-lexicographically-smallest-string.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Greedy
2436 | [Minimum Split Into Subarrays With GCD Greater Than One](https://leetcode.com/problems/minimum-split-into-subarrays-with-gcd-greater-than-one/) | [C++](./C++/minimum-split-into-subarrays-with-gcd-greater-than-one.cpp) [Python](./Python/minimum-split-into-subarrays-with-gcd-greater-than-one.py) | _O(nlogr)_ | _O(1)_ | Medium | š | Greedy
2439 | [Minimize Maximum of Array](https://leetcode.com/problems/minimize-maximum-of-array/) | [C++](./C++/minimize-maximum-of-array.cpp) [Python](./Python/minimize-maximum-of-array.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2440 | [Create Components With Same Value](https://leetcode.com/problems/create-components-with-same-value/) | [C++](./C++/create-components-with-same-value.cpp) [Python](./Python/create-components-with-same-value.py) | _O(n * sqrt(n))_ | _O(n)_ | Hard | | BFS, DFS, Greedy
2449 | [Minimum Number of Operations to Make Arrays Similar](https://leetcode.com/problems/minimum-number-of-operations-to-make-arrays-similar/) | [C++](./C++/minimum-number-of-operations-to-make-arrays-similar.cpp) [Python](./Python/minimum-number-of-operations-to-make-arrays-similar.py) | _O(nlogn)_ | _O(1)_ | Hard | | Greedy, Sort
2457 | [Minimum Addition to Make Integer Beautiful](https://leetcode.com/problems/minimum-addition-to-make-integer-beautiful/) | [C++](./C++/minimum-addition-to-make-integer-beautiful.cpp) [Python](./Python/minimum-addition-to-make-integer-beautiful.py) | _O(logn)_ | _O(1)_ | Medium | | Greedy
2459 | [Sort Array by Moving Items to Empty Space](https://leetcode.com/problems/sort-array-by-moving-items-to-empty-space/) | [C++](./C++/sort-array-by-moving-items-to-empty-space.cpp) [Python](./Python/sort-array-by-moving-items-to-empty-space.py) | _O(n)_ | _O(n)_ | Hard | š | Greedy, Sort
2472 | [Maximum Number of Non-overlapping Palindrome Substrings](https://leetcode.com/problems/maximum-number-of-non-overlapping-palindrome-substrings/) | [C++](./C++/maximum-number-of-non-overlapping-palindrome-substrings.cpp) [Python](./Python/maximum-number-of-non-overlapping-palindrome-substrings.py) | _O(n * k)_ | _O(1)_ | Hard || Two Pointers, Greedy
2479 | [Maximum XOR of Two Non-Overlapping Subtrees](https://leetcode.com/problems/maximum-xor-of-two-non-overlapping-subtrees/) | [C++](./C++/maximum-xor-of-two-non-overlapping-subtrees.cpp) [Python](./Python/maximum-xor-of-two-non-overlapping-subtrees.py) | _O(nlogr)_ | _O(n)_ | Hard | š, variant of [Maximum XOR of Two Numbers in an Array](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/) | DFS, Trie, Greedy
2483 | [Minimum Penalty for a Shop](https://leetcode.com/problems/minimum-penalty-for-a-shop/) | [C++](./C++/minimum-penalty-for-a-shop.cpp) [Python](./Python/minimum-penalty-for-a-shop.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2486 | [Append Characters to String to Make Subsequence](https://leetcode.com/problems/append-characters-to-string-to-make-subsequence/) | [C++](./C++/append-characters-to-string-to-make-subsequence.cpp) [Python](./Python/append-characters-to-string-to-make-subsequence.py) | _O(n)_ | _O(1)_ | Medium | | Two Pointers, Greedy
2498 | [Frog Jump II](https://leetcode.com/problems/frog-jump-ii/) | [C++](./C++/frog-jump-ii.cpp) [Python](./Python/frog-jump-ii.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2499 | [Minimum Total Cost to Make Arrays Unequal](https://leetcode.com/problems/minimum-total-cost-to-make-arrays-unequal/) | [C++](./C++/minimum-total-cost-to-make-arrays-unequal.cpp) [Python](./Python/minimum-total-cost-to-make-arrays-unequal.py) | _O(n)_ | _O(n)_ | Hard | | Greedy
2522 | [Partition String Into Substrings With Values at Most K](https://leetcode.com/problems/minimum-total-cost-to-make-arrays-unequal/) | [C++](./C++/partition-string-into-substrings-with-values-at-most-k.cpp) [Python](./Python/partition-string-into-substrings-with-values-at-most-k.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2541 | [Minimum Operations to Make Array Equal II](https://leetcode.com/problems/minimum-operations-to-make-array-equal-ii/) | [C++](./C++/minimum-operations-to-make-array-equal-ii.cpp) [Python](./Python/minimum-operations-to-make-array-equal-ii.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2542 | [Maximum Subsequence Score](https://leetcode.com/problems/maximum-subsequence-score/) | [C++](./C++/maximum-subsequence-score.cpp) [Python](./Python/maximum-subsequence-score.py) | _O(nlogn)_ | _O(n)_ | Medium | variant of [Maximum Performance of a Team](https://leetcode.com/problems/maximum-performance-of-a-team/) | Greedy, Heap |
2548 | [Maximum Price to Fill a Bag](https://leetcode.com/problems/maximum-price-to-fill-a-bag/) | [C++](./C++/maximum-price-to-fill-a-bag.cpp) [Python](./Python/maximum-price-to-fill-a-bag.py) | _O(nlogn)_ | _O(1)_ | Medium | š | Greedy, Sort |
2551 | [Put Marbles in Bags](https://leetcode.com/problems/put-marbles-in-bags/) | [C++](./C++/put-marbles-in-bags.cpp) [Python](./Python/put-marbles-in-bags.py) | _O(n)_ on average | _O(1)_ | Hard | | Greedy, Quick Select |
2561 | [Rearranging Fruits](https://leetcode.com/problems/rearranging-fruits/) | [C++](./C++/rearranging-fruits.cpp) [Python](./Python/rearranging-fruits.py) | _O(n)_ on average | _O(n)_ | Hard | | Freq Table, Greedy, Quick Select |
2566 | [Maximum Difference by Remapping a Digit](https://leetcode.com/problems/maximum-difference-by-remapping-a-digit/) | [C++](./C++/maximum-difference-by-remapping-a-digit.cpp) [Python](./Python/maximum-difference-by-remapping-a-digit.py) | _O(logn)_ | _O(1)_ | Easy | | Greedy |
2567 | [Minimum Score by Changing Two Elements](https://leetcode.com/problems/minimum-score-by-changing-two-elements/) | [C++](./C++/minimum-score-by-changing-two-elements.cpp) [Python](./Python/minimum-score-by-changing-two-elements.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Greedy |
2571 | [Minimum Operations to Reduce an Integer to 0](https://leetcode.com/problems/minimum-operations-to-reduce-an-integer-to-0/) | [C++](./C++/minimum-operations-to-reduce-an-integer-to-0.cpp) [Python](./Python/minimum-operations-to-reduce-an-integer-to-0.py) | _O(logn)_ | _O(1)_ | Medium | | Greedy, Trick |
2573 | [Find the String with LCP](https://leetcode.com/problems/find-the-string-with-lcp/) | [C++](./C++/find-the-string-with-lcp.cpp) [Python](./Python/find-the-string-with-lcp.py) | _O(n^2)_ | _O(1)_ | Hard | | Constructive Algorithms, Greedy, DP |
2576 | [Find the Maximum Number of Marked Indices](https://leetcode.com/problems/find-the-maximum-number-of-marked-indices/) | [C++](./C++/find-the-maximum-number-of-marked-indices.cpp) [Python](./Python/find-the-maximum-number-of-marked-indices.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Greedy, Two Pointers |
2578 | [Split With Minimum Sum](https://leetcode.com/problems/split-with-minimum-sum/) | [C++](./C++/split-with-minimum-sum.cpp) [Python](./Python/split-with-minimum-sum.py) | _O(mlogm)_ | _O(m)_ | Easy | | Sort, Greedy |
2587 | [Rearrange Array to Maximize Prefix Score](https://leetcode.com/problems/rearrange-array-to-maximize-prefix-score/) | [C++](./C++/rearrange-array-to-maximize-prefix-score.cpp) [Python](./Python/rearrange-array-to-maximize-prefix-score.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Greedy |
2589 | [Minimum Time to Complete All Tasks](https://leetcode.com/problems/minimum-time-to-complete-all-tasks/) | [C++](./C++/minimum-time-to-complete-all-tasks.cpp) [Python](./Python/minimum-time-to-complete-all-tasks.py) | _O(nlogn + n * r)_ | _O(r)_ | Hard | | Sort, Greedy |
2591 | [Distribute Money to Maximum Children](https://leetcode.com/problems/distribute-money-to-maximum-children/) | [C++](./C++/distribute-money-to-maximum-children.cpp) [Python](./Python/distribute-money-to-maximum-children.py) | _O(1)_ | _O(1)_ | Easy | | Greedy, Math |
2599 | [Make the Prefix Sum Non-negative](https://leetcode.com/problems/make-the-prefix-sum-non-negative/) | [C++](./C++/make-the-prefix-sum-non-negative.cpp) [Python](./Python/make-the-prefix-sum-non-negative.py) | _O(nlogn)_ | _O(n)_ | Medium | š | Prefix Sum, Greedy, Heap |
2600 | [K Items With the Maximum Sum](https://leetcode.com/problems/k-items-with-the-maximum-sum/) | [C++](./C++/k-items-with-the-maximum-sum.cpp) [Python](./Python/k-items-with-the-maximum-sum.py) | _O(1)_ | _O(1)_ | Easy | | Greedy, Math |
2601 | [Prime Subtraction Operation](https://leetcode.com/problems/prime-subtraction-operation/) | [C++](./C++/prime-subtraction-operation.cpp) [Python](./Python/prime-subtraction-operation.py) | _O(p + nlogp)_ | _O(p)_ | Medium | | Number Theory, Greedy, Binary Search |
2604 | [Minimum Time to Eat All Grains](https://leetcode.com/problems/minimum-time-to-eat-all-grains/) | [C++](./C++/minimum-time-to-eat-all-grains.cpp) [Python](./Python/minimum-time-to-eat-all-grains.py) | _O(mlogm + nlogn + (m + n) * logr)_ | _O(1)_ | Hard | š | Binary Search, Greedy |
2606 | [Find the Substring With Maximum Cost](https://leetcode.com/problems/find-the-substring-with-maximum-cost/) | [C++](./C++/find-the-substring-with-maximum-cost.cpp) [Python](./Python/find-the-substring-with-maximum-cost.py) | _O(n)_ | _O(1)_ | Medium | | Greedy, `Kadane's Algorithm`
2607 | [Make K-Subarray Sums Equal](https://leetcode.com/problems/make-k-subarray-sums-equal/) | [C++](./C++/make-k-subarray-sums-equal.cpp) [Python](./Python/make-k-subarray-sums-equal.py) | _O(n)_ | _O(n)_ | Medium | | Math, Greedy, Quick Select
2611 | [Mice and Cheese](https://leetcode.com/problems/mice-and-cheese/) | [C++](./C++/mice-and-cheese.cpp) [Python](./Python/mice-and-cheese.py) | _O(n)_ | _O(1)_ | Medium | | Greedy, Quick Select
2645 | [Minimum Additions to Make Valid String](https://leetcode.com/problems/minimum-additions-to-make-valid-string/) | [C++](./C++/minimum-additions-to-make-valid-string.cpp) [Python](./Python/minimum-additions-to-make-valid-string.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2663 | [Lexicographically Smallest Beautiful String](https://leetcode.com/problems/lexicographically-smallest-beautiful-string/) | [C++](./C++/lexicographically-smallest-beautiful-string.cpp) [Python](./Python/lexicographically-smallest-beautiful-string.py) | _O(n)_ | _O(1)_ | Hard | | Greedy
2673 | [Make Costs of Paths Equal in a Binary Tree](https://leetcode.com/problems/make-costs-of-paths-equal-in-a-binary-tree/) | [C++](./C++/make-costs-of-paths-equal-in-a-binary-tree.cpp) [Python](./Python/make-costs-of-paths-equal-in-a-binary-tree.py) | _O(n)_ | _O(1)_ | Medium | | Tree, Greedy
2680 | [Maximum OR](https://leetcode.com/problems/maximum-or/) | [C++](./C++/maximum-or.cpp) [Python](./Python/maximum-or.py) | _O(n)_ | _O(n)_ | Medium | | Prefix Sum, Greedy
2697 | [Lexicographically Smallest Palindrome](https://leetcode.com/problems/lexicographically-smallest-palindrome/) | [C++](./C++/lexicographically-smallest-palindrome.cpp) [Python](./Python/lexicographically-smallest-palindrome.py) | _O(n)_ | _O(1)_ | Easy | | Greedy
2706 | [Buy Two Chocolates](https://leetcode.com/problems/buy-two-chocolates/) | [C++](./C++/buy-two-chocolates.cpp) [Python](./Python/buy-two-chocolates.py) | _O(n)_ | _O(1)_ | Easy | | Greedy
2708 | [Maximum Strength of a Group](https://leetcode.com/problems/maximum-strength-of-a-group/) | [C++](./C++/maximum-strength-of-a-group.cpp) [Python](./Python/maximum-strength-of-a-group.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2712 | [Minimum Cost to Make All Characters Equal](https://leetcode.com/problems/minimum-cost-to-make-all-characters-equal/) | [C++](./C++/minimum-cost-to-make-all-characters-equal.cpp) [Python](./Python/minimum-cost-to-make-all-characters-equal.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2734 | [Lexicographically Smallest String After Substring Operation](https://leetcode.com/problems/lexicographically-smallest-string-after-substring-operation/) | [C++](./C++/lexicographically-smallest-string-after-substring-operation.cpp) [Python](./Python/lexicographically-smallest-string-after-substring-operation.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2769 | [Find the Maximum Achievable Number](https://leetcode.com/problems/find-the-maximum-achievable-number/) | [C++](./C++/find-the-maximum-achievable-number.cpp) [Python](./Python/find-the-maximum-achievable-number.py) | _O(1)_ | _O(1)_ | Easy | | Greedy, Math
2772 | [Apply Operations to Make All Array Elements Equal to Zero](https://leetcode.com/problems/apply-operations-to-make-all-array-elements-equal-to-zero/) | [C++](./C++/apply-operations-to-make-all-array-elements-equal-to-zero.cpp) [Python](./Python/apply-operations-to-make-all-array-elements-equal-to-zero.py) | _O(n)_ | _O(1)_ | Medium | | Greedy, Sliding Window
2789 | [Largest Element in an Array after Merge Operations](https://leetcode.com/problems/largest-element-in-an-array-after-merge-operations/) | [C++](./C++/largest-element-in-an-array-after-merge-operations.cpp) [Python](./Python/largest-element-in-an-array-after-merge-operations.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2790 | [Maximum Number of Groups With Increasing Length](https://leetcode.com/problems/maximum-number-of-groups-with-increasing-length/) | [C++](./C++/maximum-number-of-groups-with-increasing-length.cpp) [Python](./Python/maximum-number-of-groups-with-increasing-length.py) | _O(n)_ | _O(n)_ | Hard | | Constructive Algorithms, Counting Sort, Greedy, Binary Search, Prefix Sum
2813 | [Maximum Elegance of a K-Length Subsequence](https://leetcode.com/problems/maximum-elegance-of-a-k-length-subsequence/) | [C++](./C++/maximum-elegance-of-a-k-length-subsequence.cpp) [Python](./Python/maximum-elegance-of-a-k-length-subsequence.py) | _O(nlogk)_ | _O(k)_ | Hard | | Partial Sort, Heap, Quick Select, BST, Sorted List, Greedy
2819 | [Minimum Relative Loss After Buying Chocolates](https://leetcode.com/problems/minimum-relative-loss-after-buying-chocolates/) | [C++](./C++/minimum-relative-loss-after-buying-chocolates.cpp) [Python](./Python/minimum-relative-loss-after-buying-chocolates.py) | _O((n + q) * logn)_ | _O(n)_ | Hard | š | Sort, Binary Search, Greedy, Prefix Sum
2825 | [Make String a Subsequence Using Cyclic Increments](https://leetcode.com/problems/make-string-a-subsequence-using-cyclic-increments/) | [C++](./C++/make-string-a-subsequence-using-cyclic-increments.cpp) [Python](./Python/make-string-a-subsequence-using-cyclic-increments.py) | _O(n)_ | _O(1)_ | Medium | | Greedy, Two Pointers
2835 | [Minimum Operations to Form Subsequence With Target Sum](https://leetcode.com/problems/minimum-operations-to-form-subsequence-with-target-sum/) | [C++](./C++/minimum-operations-to-form-subsequence-with-target-sum.cpp) [Python](./Python/minimum-operations-to-form-subsequence-with-target-sum.py) | _O(n)_ | _O(logn)_ | Hard | [Educational Codeforces Round #82 D](https://codeforces.com/problemset/problem/1303/D) | Counting Sort, Sort, Heap, Greedy, Bitmasks
2842 | [Count K-Subsequences of a String With Maximum Beauty](https://leetcode.com/problems/count-k-subsequences-of-a-string-with-maximum-beauty/) | [C++](./C++/count-k-subsequences-of-a-string-with-maximum-beauty.cpp) [Python](./Python/count-k-subsequences-of-a-string-with-maximum-beauty.py) | _O(n)_ | _O(1)_ | Hard | | Greedy, Quick Select, Combinatorics
2844 | [Minimum Operations to Make a Special Number](https://leetcode.com/problems/minimum-operations-to-make-a-special-number/) | [C++](./C++/minimum-operations-to-make-a-special-number.cpp) [Python](./Python/minimum-operations-to-make-a-special-number.py) | _O(n)_ | _O(1)_ | Medium | | Math, Greedy
2847 | [Smallest Number With Given Digit Product](https://leetcode.com/problems/smallest-number-with-given-digit-product/) | [C++](./C++/smallest-number-with-given-digit-product.cpp) [Python](./Python/smallest-number-with-given-digit-product.py) | _O(logn)_ | _O(logn)_ | Medium | š | Greedy
2860 | [Happy Students](https://leetcode.com/problems/happy-students/) | [C++](./C++/happy-students.cpp) [Python](./Python/happy-students.py) | _O(n)_ | _O(n)_ | Medium | [Codeforces Round #844 B](https://codeforces.com/contest/1782/problem/B) | Sort, Greedy, Freq Table
2864 | [Maximum Odd Binary Number](https://leetcode.com/problems/maximum-odd-binary-number/) | [C++](./C++/maximum-odd-binary-number.cpp) [Python](./Python/maximum-odd-binary-number.py) | _O(n)_ | _O(1)_ | Easy | | Greedy, Partition
2868 | [The Wording Game](https://leetcode.com/problems/the-wording-game/) | [C++](./C++/the-wording-game.cpp) [Python](./Python/the-wording-game.py) | _O(m + n)_ | _O(1)_ | Hard | š | Game, Greedy
2870 | [Minimum Number of Operations to Make Array Empty](https://leetcode.com/problems/minimum-number-of-operations-to-make-array-empty/) | [C++](./C++/minimum-number-of-operations-to-make-array-empty.cpp) [Python](./Python/minimum-number-of-operations-to-make-array-empty.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Greedy
2871 | [Split Array Into Maximum Number of Subarrays](https://leetcode.com/problems/split-array-into-maximum-number-of-subarrays/) | [C++](./C++/split-array-into-maximum-number-of-subarrays.cpp) [Python](./Python/split-array-into-maximum-number-of-subarrays.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2872 | [Maximum Number of K-Divisible Components](https://leetcode.com/problems/maximum-number-of-k-divisible-components/) | [C++](./C++/maximum-number-of-k-divisible-components.cpp) [Python](./Python/maximum-number-of-k-divisible-components.py) | _O(n)_ | _O(n)_ | Hard | variant of [Create Components With Same Value](https://leetcode.com/problems/create-components-with-same-value/) | BFS, Greedy
2892 | [Minimizing Array After Replacing Pairs With Their Product](https://leetcode.com/problems/minimizing-array-after-replacing-pairs-with-their-product/) | [C++](./C++/minimizing-array-after-replacing-pairs-with-their-product.cpp) [Python](./Python/minimizing-array-after-replacing-pairs-with-their-product.py) | _O(n)_ | _O(1)_ | Medium | š | Greedy
2895 | [Minimum Processing Time](https://leetcode.com/problems/minimum-processing-time/) | [C++](./C++/minimum-processing-time.cpp) [Python](./Python/minimum-processing-time.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Greedy
2897 | [Apply Operations on Array to Maximize Sum of Squares](https://leetcode.com/problems/apply-operations-on-array-to-maximize-sum-of-squares/) | [C++](./C++/apply-operations-on-array-to-maximize-sum-of-squares.cpp) [Python](./Python/apply-operations-on-array-to-maximize-sum-of-squares.py) | _O(nlogr)_ | _O(logr)_ | Hard | | Bit Manipulation, Greedy, Freq Table
2900 | [Longest Unequal Adjacent Groups Subsequence I](https://leetcode.com/problems/longest-unequal-adjacent-groups-subsequence-i/) | [C++](./C++/longest-unequal-adjacent-groups-subsequence-i.cpp) [Python](./Python/longest-unequal-adjacent-groups-subsequence-i.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2910 | [Minimum Number of Groups to Create a Valid Assignment](https://leetcode.com/problems/minimum-number-of-groups-to-create-a-valid-assignment/) | [C++](./C++/minimum-number-of-groups-to-create-a-valid-assignment.cpp) [Python](./Python/minimum-number-of-groups-to-create-a-valid-assignment.py) | _O(n)_ | _O(n)_ | Medium | | Linear Search, Greedy, Math
2914 | [Minimum Number of Changes to Make Binary String Beautiful](https://leetcode.com/problems/minimum-number-of-changes-to-make-binary-string-beautiful/) | [C++](./C++/minimum-number-of-changes-to-make-binary-string-beautiful.cpp) [Python](./Python/minimum-number-of-changes-to-make-binary-string-beautiful.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2918 | [Minimum Equal Sum of Two Arrays After Replacing Zeros](https://leetcode.com/problems/minimum-equal-sum-of-two-arrays-after-replacing-zeros/) | [C++](./C++/minimum-equal-sum-of-two-arrays-after-replacing-zeros.cpp) [Python](./Python/minimum-equal-sum-of-two-arrays-after-replacing-zeros.py) | _O(n + m)_ | _O(1)_ | Medium | | Greedy
2931 | [Minimum Equal Sum of Two Arrays After Replacing Zeros](https://leetcode.com/problems/maximum-spending-after-buying-items/) | [C++](./C++/maximum-spending-after-buying-items.cpp) [Python](./Python/maximum-spending-after-buying-items.py) | _O(m * n * logm)_ | _O(m)_ | Hard | | Greedy, Heap
2939 | [Maximum Xor Product](https://leetcode.com/problems/maximum-xor-product/) | [C++](./C++/maximum-xor-product.cpp) [Python](./Python/maximum-xor-product.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2952 | [Minimum Number of Coins to be Added](https://leetcode.com/problems/minimum-number-of-coins-to-be-added/) | [C++](./C++/minimum-number-of-coins-to-be-added.cpp) [Python](./Python/minimum-number-of-coins-to-be-added.py) | _O(nlogn + logt)_ | _O(1)_ | Medium | variant of [Patching Array](https://leetcode.com/problems/patching-array/) | Sort, Greedy
2957 | [Remove Adjacent Almost-Equal Characters](https://leetcode.com/problems/remove-adjacent-almost-equal-characters/) | [C++](./C++/remove-adjacent-almost-equal-characters.cpp) [Python](./Python/remove-adjacent-almost-equal-characters.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
2971 | [Find Polygon With the Largest Perimeter](https://leetcode.com/problems/find-polygon-with-the-largest-perimeter/) | [C++](./C++/find-polygon-with-the-largest-perimeter.cpp) [Python](./Python/find-polygon-with-the-largest-perimeter.py) | _O(n)_ | _O(1)_ | Medium | | Sort, Prefix Sum, Greedy
3002 | [Maximum Size of a Set After Removals](https://leetcode.com/problems/maximum-size-of-a-set-after-removals/) | [C++](./C++/maximum-size-of-a-set-after-removals.cpp) [Python](./Python/maximum-size-of-a-set-after-removals.py) | _O(n)_ | _O(n)_ | Medium | | Math, Hash Table, Greedy
3003 | [Maximize the Number of Partitions After Operations](https://leetcode.com/problems/maximize-the-number-of-partitions-after-operations/) | [C++](./C++/maximize-the-number-of-partitions-after-operations.cpp) [Python](./Python/maximize-the-number-of-partitions-after-operations.py) | _O(n)_ | _O(n)_ | Hard | | Prefix Sum, Greedy
3012 | [Minimize Length of Array Using Operations](https://leetcode.com/problems/minimize-length-of-array-using-operations/) | [C++](./C++/minimize-length-of-array-using-operations.cpp) [Python](./Python/minimize-length-of-array-using-operations.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
3014 | [Minimum Number of Pushes to Type Word I](https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-i/) | [C++](./C++/minimum-number-of-pushes-to-type-word-i.cpp) [Python](./Python/minimum-number-of-pushes-to-type-word-i.py) | _O(4)_ | _O(1)_ | Easy | | Freq Table, Greedy
3016 | [Minimum Number of Pushes to Type Word II](https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii/) | [C++](./C++/minimum-number-of-pushes-to-type-word-ii.cpp) [Python](./Python/minimum-number-of-pushes-to-type-word-ii.py) | _O(n)_ | _O(26)_ | Medium | | Freq Table, Greedy
3022 | [Minimize OR of Remaining Elements Using Operations](https://leetcode.com/problems/minimize-or-of-remaining-elements-using-operations/) | [C++](./C++/minimize-or-of-remaining-elements-using-operations.cpp) [Python](./Python/minimize-or-of-remaining-elements-using-operations.py) | _O(nlogr)_ | _O(1)_ | Hard | | Bitmasks, Greedy
3035 | [Maximum Palindromes After Operations](https://leetcode.com/problems/maximum-palindromes-after-operations/) | [C++](./C++/maximum-palindromes-after-operations.cpp) [Python](./Python/maximum-palindromes-after-operations.py) | _O(n * l + nlogn)_ | _O(n)_ | Medium | | Freq Table, Greedy, Sort
3068 | [Find the Maximum Sum of Node Values](https://leetcode.com/problems/find-the-maximum-sum-of-node-values/) | [C++](./C++/find-the-maximum-sum-of-node-values.cpp) [Python](./Python/find-the-maximum-sum-of-node-values.py) | _O(n)_ | _O(1)_ | Hard | | Greedy
3074 | [Apple Redistribution into Boxes](https://leetcode.com/problems/apple-redistribution-into-boxes/) | [C++](./C++/apple-redistribution-into-boxes.cpp) [Python](./Python/apple-redistribution-into-boxes.py) | _O(nlogn)_ | _O(1)_ | Easy | | Sort, Greedy
3075 | [Maximize Happiness of Selected Children](https://leetcode.com/problems/maximize-happiness-of-selected-children/) | [C++](./C++/maximize-happiness-of-selected-children.cpp) [Python](./Python/maximize-happiness-of-selected-children.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Greedy
3086 | [Minimum Moves to Pick K Ones](https://leetcode.com/problems/minimum-moves-to-pick-k-ones/) | [C++](./C++/minimum-moves-to-pick-k-ones.cpp) [Python](./Python/minimum-moves-to-pick-k-ones.py) | _O(n)_ | _O(n)_ | Hard | | Prefix Sum, Greedy
3088 | [Make String Anti-palindrome](https://leetcode.com/problems/make-string-anti-palindrome/) | [C++](./C++/make-string-anti-palindrome.cpp) [Python](./Python/make-string-anti-palindrome.py) | _O(n + 26)_ | _O(26)_ | Hard | š | Freq Table, Counting Sort, Greedy, Two Pointers
3106 | [Lexicographically Smallest String After Operations With Constraint](https://leetcode.com/problems/lexicographically-smallest-string-after-operations-with-constraint/) | [C++](./C++/lexicographically-smallest-string-after-operations-with-constraint.cpp) [Python](./Python/lexicographically-smallest-string-after-operations-with-constraint.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
3107 | [Minimum Operations to Make Median of Array Equal to K](https://leetcode.com/problems/minimum-operations-to-make-median-of-array-equal-to-k/) | [C++](./C++/minimum-operations-to-make-median-of-array-equal-to-k.cpp) [Python](./Python/minimum-operations-to-make-median-of-array-equal-to-k.py) | _O(n)_ | _O(1)_ | Medium | | Sort, Quick Select, Greedy
3111 | [Minimum Rectangles to Cover Points](https://leetcode.com/problems/minimum-rectangles-to-cover-points/) | [C++](./C++/minimum-rectangles-to-cover-points.cpp) [Python](./Python/minimum-rectangles-to-cover-points.py) | _O(nlogn)_ | _O(n)_ | Medium | | Sort, Greedy
3114 | [Latest Time You Can Obtain After Replacing Characters](https://leetcode.com/problems/latest-time-you-can-obtain-after-replacing-characters/)| [C++](./C++/latest-time-you-can-obtain-after-replacing-characters.cpp) [Python](./Python/latest-time-you-can-obtain-after-replacing-characters.py)| _O(1)_ | _O(1)_ | Easy | | String, Greedy |
3119 | [Maximum Number of Potholes That Can Be Fixed](https://leetcode.com/problems/maximum-number-of-potholes-that-can-be-fixed/)| [C++](./C++/maximum-number-of-potholes-that-can-be-fixed.cpp) [Python](./Python/maximum-number-of-potholes-that-can-be-fixed.py)| _O(n)_ | _O(n)_ | Medium | š | Sort, Counting Sort, Greedy |
3170 | [Lexicographically Minimum String After Removing Stars](https://leetcode.com/problems/lexicographically-minimum-string-after-removing-stars/)| [C++](./C++/lexicographically-minimum-string-after-removing-stars.cpp) [Python](./Python/lexicographically-minimum-string-after-removing-stars.py)| _O(n + 26)_ | _O(n + 26)_ | Medium | | Greedy, Hash Table, Stack |
3189 | [Minimum Moves to Get a Peaceful Board](https://leetcode.com/problems/minimum-moves-to-get-a-peaceful-board/) | [C++](./C++/minimum-moves-to-get-a-peaceful-board.cpp) [Python](./Python/minimum-moves-to-get-a-peaceful-board.py) | _O(n)_ | _O(n)_ | Medium | š, variant of [Distribute Coins in Binary Tree](https://leetcode.com/problems/distribute-coins-in-binary-tree/) | Counting Sort, Prefix Sum, Greedy
3191 | [Minimum Operations to Make Binary Array Elements Equal to One I](https://leetcode.com/problems/minimum-operations-to-make-binary-array-elements-equal-to-one-i/) | [C++](./C++/minimum-operations-to-make-binary-array-elements-equal-to-one-i.cpp) [Python](./Python/minimum-operations-to-make-binary-array-elements-equal-to-one-i.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
3192 | [Minimum Operations to Make Binary Array Elements Equal to One II](https://leetcode.com/problems/minimum-operations-to-make-binary-array-elements-equal-to-one-ii/) | [C++](./C++/minimum-operations-to-make-binary-array-elements-equal-to-one-ii.cpp) [Python](./Python/minimum-operations-to-make-binary-array-elements-equal-to-one-ii.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
3205 | [Maximum Array Hopping Score I](https://leetcode.com/problems/maximum-array-hopping-score-i/)| [C++](./C++/maximum-array-hopping-score-i.cpp) [Python](./Python/maximum-array-hopping-score-i.py)| _O(n)_ | _O(1)_ | Medium | š | DP, Prefix Sum, Greedy |
3207 | [Maximum Points After Enemy Battles](https://leetcode.com/problems/maximum-points-after-enemy-battles/)| [C++](./C++/maximum-points-after-enemy-battles.cpp) [Python](./Python/maximum-points-after-enemy-battles.py)| _O(n)_ | _O(1)_ | Medium | | Greedy |
3216 | [Lexicographically Smallest String After a Swap](https://leetcode.com/problems/lexicographically-smallest-string-after-a-swap/)| [C++](./C++/lexicographically-smallest-string-after-a-swap.cpp) [Python](./Python/lexicographically-smallest-string-after-a-swap.py)| _O(n)_ | _O(1)_ | Easy | | Greedy |
3218 | [Minimum Cost for Cutting Cake I](https://leetcode.com/problems/minimum-cost-for-cutting-cake-i/)| [C++](./C++/minimum-cost-for-cutting-cake-i.cpp) [Python](./Python/minimum-cost-for-cutting-cake-i.py)| _O(mlogm + nlogn)_ | _O(1)_ | Medium | | Memoization, Greedy |
3219 | [Minimum Cost for Cutting Cake II](https://leetcode.com/problems/minimum-cost-for-cutting-cake-ii/)| [C++](./C++/minimum-cost-for-cutting-cake-ii.cpp) [Python](./Python/minimum-cost-for-cutting-cake-ii.py)| _O(mlogm + nlogn)_ | _O(1)_ | Hard | | Greedy |
3221 | [Maximum Array Hopping Score II](https://leetcode.com/problems/maximum-array-hopping-score-ii/)| [C++](./C++/maximum-array-hopping-score-ii.cpp) [Python](./Python/maximum-array-hopping-score-ii.py)| _O(n)_ | _O(1)_ | Medium | š | Prefix Sum, Greedy |
3228 | [Maximum Number of Operations to Move Ones to the End](https://leetcode.com/problems/maximum-number-of-operations-to-move-ones-to-the-end/)| [C++](./C++/maximum-number-of-operations-to-move-ones-to-the-end.cpp) [Python](./Python/maximum-number-of-operations-to-move-ones-to-the-end.py)| _O(n)_ | _O(1)_ | Medium | | Greedy |
3229 | [Minimum Operations to Make Array Equal to Target](https://leetcode.com/problems/minimum-operations-to-make-array-equal-to-target/)| [C++](./C++/minimum-operations-to-make-array-equal-to-target.cpp) [Python](./Python/minimum-operations-to-make-array-equal-to-target.py)| _O(n)_ | _O(1)_ | Hard | variant of [Minimum Number of Increments on Subarrays to Form a Target Array](https://leetcode.com/problems/minimum-number-of-increments-on-subarrays-to-form-a-target-array/) | Greedy |
3239 | [Minimum Number of Flips to Make Binary Grid Palindromic I](https://leetcode.com/problems/minimum-number-of-flips-to-make-binary-grid-palindromic-i/) | [C++](./C++/minimum-number-of-flips-to-make-binary-grid-palindromic-i.cpp) [Python](./Python/minimum-number-of-flips-to-make-binary-grid-palindromic-i.py) | _O(m * n)_ | _O(1)_ | Medium | | Array, Greedy
3240 | [Minimum Number of Flips to Make Binary Grid Palindromic II](https://leetcode.com/problems/minimum-number-of-flips-to-make-binary-grid-palindromic-ii/) | [C++](./C++/minimum-number-of-flips-to-make-binary-grid-palindromic-ii.cpp) [Python](./Python/minimum-number-of-flips-to-make-binary-grid-palindromic-ii.py) | _O(m * n)_ | _O(1)_ | Medium | | Array, Greedy
3273 | [Minimum Amount of Damage Dealt to Bob](https://leetcode.com/problems/minimum-amount-of-damage-dealt-to-bob/) | [C++](./C++/minimum-amount-of-damage-dealt-to-bob.cpp) [Python](./Python/minimum-amount-of-damage-dealt-to-bob.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sort, Greedy
3282 | [Reach End of Array With Max Score](https://leetcode.com/problems/reach-end-of-array-with-max-score/) | [C++](./C++/reach-end-of-array-with-max-score.cpp) [Python](./Python/reach-end-of-array-with-max-score.py) | _O(n)_ | _O(1)_ | Medium | | Greedy
3301 | [Maximize the Total Height of Unique Towers](https://leetcode.com/problems/maximize-the-total-height-of-unique-towers/) | [C++](./C++/maximize-the-total-height-of-unique-towers.cpp) [Python](./Python/maximize-the-total-height-of-unique-towers.py) | _O(nlogn)_ | _O(1)_ | Medium | | Sort, Greedy
3302 | [Find the Lexicographically Smallest Valid Sequence](https://leetcode.com/problems/find-the-lexicographically-smallest-valid-sequence/) | [C++](./C++/find-the-lexicographically-smallest-valid-sequence.cpp) [Python](./Python/find-the-lexicographically-smallest-valid-sequence.py) | _O(n + m)_ | _O(m)_ | Medium | | Hash Table, Greedy
3362 | [Zero Array Transformation III](https://leetcode.com/problems/zero-array-transformation-iii/) | [C++](./C++/zero-array-transformation-iii.cpp) [Python](./Python/zero-array-transformation-iii.py) | _O(n + qlogq)_ | _O(q)_ | Medium | | Sort, Heap, Greedy
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Graph
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2076 | [Process Restricted Friend Requests](https://leetcode.com/problems/process-restricted-friend-requests/) | [C++](./C++/process-restricted-friend-requests.cpp) [Python](./Python/process-restricted-friend-requests.py) | _O(n * r)_ | _O(n)_ | Hard | | Union Find |
2077 | [Paths in Maze That Lead to Same Room](https://leetcode.com/problems/paths-in-maze-that-lead-to-same-room/) | [C++](./C++/paths-in-maze-that-lead-to-same-room.cpp) [Python](./Python/paths-in-maze-that-lead-to-same-room.py) | _O(\|V\|^3)_ | _O(\|E\|)_ | Medium | š | |
2092 | [Find All People With Secret](https://leetcode.com/problems/find-all-people-with-secret/) | [C++](./C++/find-all-people-with-secret.cpp) [Python](./Python/find-all-people-with-secret.py) | _O(nlogn)_ | _O(nlogn)_ | Hard | | BFS, DFS, Union Find |
2093 | [Minimum Path Cost in a Hidden Grid](https://leetcode.com/problems/minimum-cost-to-reach-city-with-discounts/) | [C++](./C++/minimum-cost-to-reach-city-with-discounts.cpp) [Python](./Python/minimum-cost-to-reach-city-with-discounts.py) | _O(\|E\| * log\|V\|)_ | _O(\|V\| + \|E\|)_ | Medium | variant of [Cheapest Flights Within K Stops](https://leetcode.com/problems/cheapest-flights-within-k-stops/), š | `Dijkstra's Algorithm`, DP |
2097 | [Valid Arrangement of Pairs](https://leetcode.com/problems/valid-arrangement-of-pairs/) | [C++](./C++/valid-arrangement-of-pairs.cpp) [Python](./Python/valid-arrangement-of-pairs.py) | _O(\|V\| + \|E\|)_ | _O(\|V\| + \|E\|)_ | Hard | variant of [Reconstruct Itinerary](https://leetcode.com/problems/reconstruct-itinerary/) | `Hierholzer's Algorithm`, Eulerian Path |
2123 | [Minimum Operations to Remove Adjacent Ones in Matrix](https://leetcode.com/problems/minimum-operations-to-remove-adjacent-ones-in-matrix/) | [C++](./C++/minimum-operations-to-remove-adjacent-ones-in-matrix.cpp) [Python](./Python/minimum-operations-to-remove-adjacent-ones-in-matrix.py) | _O(m * n * sqrt(m * n))_ | _O(m + n)_ | Hard | variant of [Maximum Students Taking Exam](https://leetcode.com/problems/maximum-students-taking-exam/), š | `Hopcroft-Karp Bipartite Matching`, Maximum Independent Set |
2127 | [Maximum Employees to Be Invited to a Meeting](https://leetcode.com/problems/maximum-employees-to-be-invited-to-a-meeting/) | [C++](./C++/maximum-employees-to-be-invited-to-a-meeting.cpp) [Python](./Python/maximum-employees-to-be-invited-to-a-meeting.py) | _O(n)_ | _O(n)_ | Hard | | |
2172 | [Maximum AND Sum of Array](https://leetcode.com/problems/maximum-and-sum-of-array/) | [C++](./C++/maximum-and-sum-of-array.cpp) [Python](./Python/maximum-and-sum-of-array.py) | _O(n^3)_ | _O(n^2)_ | Hard | variant of [Maximum Compatibility Score Sum](https://leetcode.com/problems/maximum-compatibility-score-sum/) | DP, `Hungarian Weighted Bipartite Matching` |
2203 | [Minimum Weighted Subgraph With the Required Paths](https://leetcode.com/problems/minimum-weighted-subgraph-with-the-required-paths/)| [C++](./C++/minimum-weighted-subgraph-with-the-required-paths.cpp) [Python](./Python/minimum-weighted-subgraph-with-the-required-paths.py)| _O(\|E\| * log\|V\|)_ | _O(\|E\|)_ | Hard | | `Dijkstra's Algorithm` |
2204 | [Distance to a Cycle in Undirected Graph](https://leetcode.com/problems/distance-to-a-cycle-in-undirected-graph/) | [C++](./C++/distance-to-a-cycle-in-undirected-graph.cpp) [Python](./Python/distance-to-a-cycle-in-undirected-graph.py) | _O(\|V\| + \|E\|)_ | _O(\|V\| + \|E\|)_ | Hard | š | Graph, DFS, BFS |
2242 | [Maximum Score of a Node Sequence](https://leetcode.com/problems/maximum-score-of-a-node-sequence/) | [C++](./C++/maximum-score-of-a-node-sequence.cpp) [Python](./Python/maximum-score-of-a-node-sequence.py) | _O(\|V\| + \|E\|)_ | _O(\|V\|)_ | Hard | | Graph |
2307 | [Check for Contradictions in Equations](https://leetcode.com/problems/check-for-contradictions-in-equations/) | [C++](./C++/check-for-contradictions-in-equations.cpp) [Python](./Python/check-for-contradictions-in-equations.py) | _O(e + q)_ | _O(n)_ | Hard | š, variant of [Evaluate Division](https://leetcode.com/problems/evaluate-division/) | DFS, Union Find|
2359 | [Find Closest Node to Given Two Nodes](https://leetcode.com/problems/find-closest-node-to-given-two-nodes/) | [C++](./C++/find-closest-node-to-given-two-nodes.cpp) [Python](./Python/find-closest-node-to-given-two-nodes.py) | _O(n)_ | _O(n)_ | Medium | | Graph, Hash Table, DFS |
2360 | [Longest Cycle in a Graph](https://leetcode.com/problems/longest-cycle-in-a-graph/) | [C++](./C++/longest-cycle-in-a-graph.cpp) [Python](./Python/longest-cycle-in-a-graph.py) | _O(n)_ | _O(n)_ | Hard | | Graph, Hash Table, DFS |
2392 | [Build a Matrix With Conditions](https://leetcode.com/problems/build-a-matrix-with-conditions/) | [C++](./C++/build-a-matrix-with-conditions.cpp) [Python](./Python/build-a-matrix-with-conditions.py) | _O(k^2 + r + c)_ | _O(k + r + c)_ | Hard | | Graph, Topological Sort |
2473 | [Minimum Cost to Buy Apples](https://leetcode.com/problems/minimum-cost-to-buy-apples/) | [C++](./C++/minimum-cost-to-buy-apples.cpp) [Python](./Python/minimum-cost-to-buy-apples.py) | _O(n * rlogn)_ | _O(n)_| Medium |š| `Dijkstra's Algorithm`|
2508 | [Add Edges to Make Degrees of All Nodes Even](https://leetcode.com/problems/add-edges-to-make-degrees-of-all-nodes-even/) | [C++](./C++/add-edges-to-make-degrees-of-all-nodes-even.cpp) [Python](./Python/add-edges-to-make-degrees-of-all-nodes-even.py) | _O(n)_ | _O(n)_| Hard || Graph |
2608 | [Shortest Cycle in a Graph](https://leetcode.com/problems/shortest-cycle-in-a-graph/) | [C++](./C++/shortest-cycle-in-a-graph.cpp) [Python](./Python/shortest-cycle-in-a-graph.py) | _O(n^2)_ | _O(n + e)_| Hard || Graph, BFS |
2662 | [Minimum Cost of a Path With Special Roads](https://leetcode.com/problems/minimum-cost-of-a-path-with-special-roads/) | [C++](./C++/minimum-cost-of-a-path-with-special-roads.cpp) [Python](./Python/minimum-cost-of-a-path-with-special-roads.py) | _O(n^2)_ | _O(n^2)_| Medium || Graph, `Dijkstra's Algorithm` |
2699 | [Modify Graph Edge Weights](https://leetcode.com/problems/modify-graph-edge-weights/) | [C++](./C++/modify-graph-edge-weights.cpp) [Python](./Python/modify-graph-edge-weights.py) | _O(\|E\| * log\|V\|)_ | _O(\|E\|)_ | Hard || Graph, `Dijkstra's Algorithm` |
2714 | [Find Shortest Path with K Hops](https://leetcode.com/problems/find-shortest-path-with-k-hops/) | [C++](./C++/find-shortest-path-with-k-hops.cpp) [Python](./Python/find-shortest-path-with-k-hops.py) | _O(n * k + (k * e) * log(n * k))_ | _O(n * k + e)_ | Hard |š| Graph, `Dijkstra's Algorithm` |
2737 | [Find the Closest Marked Node](https://leetcode.com/problems/find-the-closest-marked-node/) | [C++](./C++/find-the-closest-marked-node.cpp) [Python](./Python/find-the-closest-marked-node.py) | _O(\|E\| * log\|V\|)_ | _O(\|E\|)_ | Medium |š| Graph, `Dijkstra's Algorithm` |
2836 | [Maximize Value of Function in a Ball Passing Game](https://leetcode.com/problems/maximize-value-of-function-in-a-ball-passing-game/) | [C++](./C++/maximize-value-of-function-in-a-ball-passing-game.cpp) [Python](./Python/maximize-value-of-function-in-a-ball-passing-game.py) | _O(n)_ | _O(n)_| Hard || Graph, Prefix Sum, Two Pointers, Sliding Window, Binary Lifting |
2850 | [Minimum Moves to Spread Stones Over Grid](https://leetcode.com/problems/minimum-moves-to-spread-stones-over-grid/) | [C++](./C++/minimum-moves-to-spread-stones-over-grid.cpp) [Python](./Python/minimum-moves-to-spread-stones-over-grid.py) | _O(n^3)_ | _O(n^2)_ | Medium | | Backtracking, `Hungarian Weighted Bipartite Matching` |
2876 | [Count Visited Nodes in a Directed Graph](https://leetcode.com/problems/count-visited-nodes-in-a-directed-graph/) | [C++](./C++/count-visited-nodes-in-a-directed-graph.cpp) [Python](./Python/count-visited-nodes-in-a-directed-graph.py) | _O(n)_ | _O(n)_ | Hard | | Graph, Hash Table, Stack |
2924 | [Find Champion II](https://leetcode.com/problems/find-champion-ii/) | [C++](./C++/find-champion-ii.cpp) [Python](./Python/find-champion-ii.py) | _O(n)_ | _O(n)_ | Medium | | Graph, Hash Table
2959 | [Number of Possible Sets of Closing Branches](https://leetcode.com/problems/number-of-possible-sets-of-closing-branches/) | [C++](./C++/number-of-possible-sets-of-closing-branches.cpp) [Python](./Python/number-of-possible-sets-of-closing-branches.py) | _O(r + 2^n * n^2)_ | _O(n^3)_ | Medium | | Graph, Bitmasks, `Floyd-Warshall Algorithm`, Backtracking
3108 | [Minimum Cost Walk in Weighted Graph](https://leetcode.com/problems/minimum-cost-walk-in-weighted-graph/) | [C++](./C++/minimum-cost-walk-in-weighted-graph.cpp) [Python](./Python/minimum-cost-walk-in-weighted-graph.py) | _O(n + e + q)_ | _O(n)_ | Hard | | Union Find
3112 | [Minimum Time to Visit Disappearing Nodes](https://leetcode.com/problems/find-the-closest-marked-node/) | [C++](./C++/minimum-time-to-visit-disappearing-nodes.cpp) [Python](./Python/minimum-time-to-visit-disappearing-nodes.py) | _O(\|E\| * log\|V\|)_ | _O(\|E\|)_ | Medium | | Graph, `Dijkstra's Algorithm` |
3123 | [Find Edges in Shortest Paths](https://leetcode.com/problems/find-edges-in-shortest-paths/) | [C++](./C++/find-edges-in-shortest-paths.cpp) [Python](./Python/find-edges-in-shortest-paths.py) | _O(\|E\| * log\|V\|)_ | _O(\|E\|)_ | Hard | | Graph, `Dijkstra's Algorithm` |
3235 | [Check if the Rectangle Corner Is Reachable](https://leetcode.com/problems/check-if-the-rectangle-corner-is-reachable/) | [C++](./C++/check-if-the-rectangle-corner-is-reachable.cpp) [Python](./Python/check-if-the-rectangle-corner-is-reachable.py) | _O(n^2)_ | _O(n)_ | Hard | | Graph, BFS, DFS, Union Find |
3243 | [Shortest Distance After Road Addition Queries I](https://leetcode.com/problems/shortest-distance-after-road-addition-queries-i/) | [C++](./C++/shortest-distance-after-road-addition-queries-i.cpp) [Python](./Python/shortest-distance-after-road-addition-queries-i.py) | _O(n^2)_ | _O(n^2)_ | Medium | | Graph, `Dijkstra's Algorithm`, BFS |
3244 | [Shortest Distance After Road Addition Queries II](https://leetcode.com/problems/shortest-distance-after-road-addition-queries-ii/) | [C++](./C++/shortest-distance-after-road-addition-queries-ii.cpp) [Python](./Python/shortest-distance-after-road-addition-queries-ii.py) | _O(nlogn)_ | _O(n)_ | Hard | | Graph, BST, Sorted List |
3265 | [Count Almost Equal Pairs I](https://leetcode.com/problems/count-almost-equal-pairs-i/) | [C++](./C++/count-almost-equal-pairs-i.cpp) [Python](./Python/count-almost-equal-pairs-i.py) | _O(n * l^2)_ | _O(n)_ | Medium | | Freq Table, Combinatorics, Graph, BFS |
3267 | [Count Almost Equal Pairs II](https://leetcode.com/problems/count-almost-equal-pairs-ii/) | [C++](./C++/count-almost-equal-pairs-ii.cpp) [Python](./Python/count-almost-equal-pairs-ii.py) | _O(n * l^4)_ | _O(n)_ | Hard | | Freq Table, Combinatorics, Graph, BFS |
3276 | [Select Cells in Grid With Maximum Score](https://leetcode.com/problems/select-cells-in-grid-with-maximum-score/) | [C++](./C++/select-cells-in-grid-with-maximum-score.cpp) [Python](./Python/select-cells-in-grid-with-maximum-score.py) | _O(n^2 * max(n, r))_ | _O(n * max(n, r))_ | Hard | variant of [Maximum Compatibility Score Sum](https://leetcode.com/problems/maximum-compatibility-score-sum/) | `Hungarian Weighted Bipartite Matching`, DP, Bitmasks |
3310 | [Remove Methods From Project](https://leetcode.com/problems/remove-methods-from-project/)| [C++](./C++/remove-methods-from-project.cpp) [Python](./Python/remove-methods-from-project.py)| _O(n + e)_ | _O(n + e)_ | Medium | | Graph, BFS |
3341 | [Find Minimum Time to Reach Last Room I](https://leetcode.com/problems/find-minimum-time-to-reach-last-room-i/) | [C++](./C++/find-minimum-time-to-reach-last-room-i.cpp) [Python](./Python/find-minimum-time-to-reach-last-room-i.py) | _O(n * m * log(n * m))_ | _O(n * m)_ | Medium | | Graph, `Dijkstra's Algorithm` |
3342 | [Find Minimum Time to Reach Last Room II](https://leetcode.com/problems/find-minimum-time-to-reach-last-room-ii/) | [C++](./C++/find-minimum-time-to-reach-last-room-ii.cpp) [Python](./Python/find-minimum-time-to-reach-last-room-ii.py) | _O(n * m * log(n * m))_ | _O(n * m)_ | Medium | | Graph, `Dijkstra's Algorithm` |
3377 | [Digit Operations to Make Two Integers Equal](https://leetcode.com/problems/digit-operations-to-make-two-integers-equal/) | [C++](./C++/digit-operations-to-make-two-integers-equal.cpp) [Python](./Python/digit-operations-to-make-two-integers-equal.py) | _O(nlogn)_ | _O(n)_ | Medium | | Graph, Number Theory, `Linear Sieve of Eratosthenes`, `Dijkstra's Algorithm` |
3378 | [Count Connected Components in LCM Graph](https://leetcode.com/problems/count-connected-components-in-lcm-graph/) | [C++](./C++/count-connected-components-in-lcm-graph.cpp) [Python](./Python/count-connected-components-in-lcm-graph.py) | _O(n + tlogt)_ | _O(t)_ | Hard | | Number Theory, Graph, Union Find |
3383 | [Minimum Runes to Add to Cast Spell](https://leetcode.com/problems/minimum-runes-to-add-to-cast-spell/) | [C++](./C++/minimum-runes-to-add-to-cast-spell.cpp) [Python](./Python/minimum-runes-to-add-to-cast-spell.py) | _O(n)_ | _O(n)_ | Hard | š | Graph, `Tarjan's Strongly Connected Components Algorithm`, SCC |
3376 | [Minimum Time to Break Locks I](https://leetcode.com/problems/minimum-time-to-break-locks-i/) | [C++](./C++/minimum-time-to-break-locks-i.cpp) [Python](./Python/minimum-time-to-break-locks-i.py) | _O(n^3)_ | _O(n^2)_ | Medium | | Bitmasks, DP, Graph, `Hungarian Weighted Bipartite Matching`
3385 | [Minimum Time to Break Locks II](https://leetcode.com/problems/minimum-time-to-break-locks-ii/) | [C++](./C++/minimum-time-to-break-locks-ii.cpp) [Python](./Python/minimum-time-to-break-locks-ii.py) | _O(n^3)_ | _O(n^2)_ | Hard | š | Graph, `Hungarian Weighted Bipartite Matching`
3387 | [Maximize Amount After Two Days of Conversions](https://leetcode.com/problems/maximize-amount-after-two-days-of-conversions/) | [C++](./C++/maximize-amount-after-two-days-of-conversions.cpp) [Python](./Python/maximize-amount-after-two-days-of-conversions.py) | _O(n^2)_ | _O(n)_ | Medium | | `Bellman-Ford Algorithm`, BFS |
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Geometry
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2101 | [Detonate the Maximum Bombs](https://leetcode.com/problems/detonate-the-maximum-bombs/) | [C++](./C++/detonate-the-maximum-bombs.cpp) [Python](./Python/detonate-the-maximum-bombs.py) | _O(\|V\|^2 + \V\| * \|E\|)_ | _O(\V\| + \|E\|)_ | Medium | | Graph, DFS, BFS
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Simulation
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2061 | [Number of Spaces Cleaning Robot Cleaned](https://leetcode.com/problems/number-of-spaces-cleaning-robot-cleaned/) | [C++](./C++/number-of-spaces-cleaning-robot-cleaned.cpp) [Python](./Python/number-of-spaces-cleaning-robot-cleaned.py) | _O(m * n)_ | _O(1)_ | Medium |š||
2162 | [Minimum Cost to Set Cooking Time](https://leetcode.com/problems/minimum-cost-to-set-cooking-time/) | [C++](./C++/minimum-cost-to-set-cooking-time.cpp) [Python](./Python/minimum-cost-to-set-cooking-time.py) | _O(1)_ | _O(1)_ | Medium ||
2257 | [Count Unguarded Cells in the Grid](https://leetcode.com/problems/count-unguarded-cells-in-the-grid/) | [C++](./C++/count-unguarded-cells-in-the-grid.cpp) [Python](./Python/count-unguarded-cells-in-the-grid.py) | _O(m * n)_ | _O(m * n)_ | Medium | | Array, Simulation
2303 | [Calculate Amount Paid in Taxes](https://leetcode.com/problems/calculate-amount-paid-in-taxes/) | [C++](./C++/calculate-amount-paid-in-taxes.cpp) [Python](./Python/calculate-amount-paid-in-taxes.py) | _O(n)_ | _O(1)_ | Easy | | Simulation
2507 | [Smallest Value After Replacing With Sum of Prime Factors](https://leetcode.com/problems/smallest-value-after-replacing-with-sum-of-prime-factors/) | [C++](./C++/smallest-value-after-replacing-with-sum-of-prime-factors.cpp) [Python](./Python/smallest-value-after-replacing-with-sum-of-prime-factors.py) | _O(s * logn)_ | _O(max_n^0.5)_ | Medium | | Number Theory, Simulation
2532 | [Time to Cross a Bridge](https://leetcode.com/problems/time-to-cross-a-bridge/) | [C++](./C++/time-to-cross-a-bridge.cpp) [Python](./Python/time-to-cross-a-bridge.py) | _O(k + nlogk)_ | _O(k)_ | Hard | | Heap, Simulation |
2534 | [Time Taken to Cross the Door](https://leetcode.com/problems/time-taken-to-cross-the-door/) | [C++](./C++/time-taken-to-cross-the-door.cpp) [Python](./Python/time-taken-to-cross-the-door.py) | _O(n)_ | _O(n)_ | Hard | š | Queue, Simulation |
2593 | [Find Score of an Array After Marking All Elements](https://leetcode.com/problems/find-score-of-an-array-after-marking-all-elements/) | [C++](./C++/find-score-of-an-array-after-marking-all-elements.cpp) [Python](./Python/find-score-of-an-array-after-marking-all-elements.py) | _O(nlogn)_ | _O(n)_ | Medium | | Simulation, Sort, Hash Table |
2596 | [Check Knight Tour Configuration](https://leetcode.com/problems/check-knight-tour-configuration/) | [C++](./C++/check-knight-tour-configuration.cpp) [Python](./Python/check-knight-tour-configuration.py) | _O(m * n)_ | _O(m * n)_ | Medium | | Simulation, Hash Table |
2682 | [Find the Losers of the Circular Game](https://leetcode.com/problems/find-the-losers-of-the-circular-game/) | [C++](./C++/find-the-losers-of-the-circular-game.cpp) [Python](./Python/find-the-losers-of-the-circular-game.py) | _O(n)_ | _O(n)_ | Easy | | Hash Table, Simulation
2751 | [Robot Collisions](https://leetcode.com/problems/robot-collisions/) | [C++](./C++/robot-collisions.cpp) [Python](./Python/robot-collisions.py) | _O(nlogn)_ | _O(n)_ | Hard | | Sort, Simulation, Stack
2934 | [Minimum Operations to Maximize Last Elements in Arrays](https://leetcode.com/problems/minimum-operations-to-maximize-last-elements-in-arrays/) | [C++](./C++/minimum-operations-to-maximize-last-elements-in-arrays.cpp) [Python](./Python/minimum-operations-to-maximize-last-elements-in-arrays.py) | _O(n)_ | _O(1)_ | Medium | | Simulation
2960 | [Count Tested Devices After Test Operations](https://leetcode.com/problems/count-tested-devices-after-test-operations/) | [C++](./C++/count-tested-devices-after-test-operations.cpp) [Python](./Python/count-tested-devices-after-test-operations.py) | _O(n)_ | _O(1)_ | Easy | | Simulation
3100 | [Water Bottles II](https://leetcode.com/problems/water-bottles-ii/) | [C++](./C++/water-bottles-ii.cpp) [Python](./Python/water-bottles-ii.py) | _O(sqrt(n))_ | _O(1)_ | Medium | | Simulation
3168 | [Minimum Number of Chairs in a Waiting Room](https://leetcode.com/problems/minimum-number-of-chairs-in-a-waiting-room/) | [C++](./C++/minimum-number-of-chairs-in-a-waiting-room.cpp) [Python](./Python/minimum-number-of-chairs-in-a-waiting-room.py) | _O(n)_ | _O(1)_ | Easy | | Simulation
3175 | [Find The First Player to win K Games in a Row](https://leetcode.com/problems/find-the-first-player-to-win-k-games-in-a-row/) | [C++](./C++/find-the-first-player-to-win-k-games-in-a-row.cpp) [Python](./Python/find-the-first-player-to-win-k-games-in-a-row.py) | _O(n)_ | _O(1)_ | Medium | | Simulation
3248 | [Snake in Matrix](https://leetcode.com/problems/snake-in-matrix/) | [C++](./C++/snake-in-matrix.cpp) [Python](./Python/snake-in-matrix.py) | _O(c)_ | _O(1)_ | Medium | | Simulation
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Constructive Algorithms
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2202 | [Maximize the Topmost Element After K Moves](https://leetcode.com/problems/maximize-the-topmost-element-after-k-moves/) | [C++](./C++/maximize-the-topmost-element-after-k-moves.cpp) [Python](./Python/maximize-the-topmost-element-after-k-moves.py) | _O(min(n, k))_ | _O(1)_ | Medium | | Constructive Algorithms
2335 | [Minimum Amount of Time to Fill Cups](https://leetcode.com/problems/minimum-amount-of-time-to-fill-cups/)|[C++](./C++/minimum-amount-of-time-to-fill-cups.cpp) [Python](./Python/minimum-amount-of-time-to-fill-cups.py)| _O(1)_ | _O(1)_ | Easy | | Math, Constructive Algorithms
2350 | [Shortest Impossible Sequence of Rolls](https://leetcode.com/problems/shortest-impossible-sequence-of-rolls/)|[C++](./C++/shortest-impossible-sequence-of-rolls.cpp) [Python](./Python/shortest-impossible-sequence-of-rolls.py)| _O(n)_ | _O(k)_ | Hard | | Constructive Algorithms
2546 | [Apply Bitwise Operations to Make Strings Equal](https://leetcode.com/problems/apply-bitwise-operations-to-make-strings-equal/) | [C++](./C++/apply-bitwise-operations-to-make-strings-equal.cpp) [Python](./Python/apply-bitwise-operations-to-make-strings-equal.py) | _O(n)_ | _O(1)_ | Medium | | Constructive Algorithms
2358 | [Maximum Number of Groups Entering a Competition](https://leetcode.com/problems/maximum-number-of-groups-entering-a-competition/)|[C++](./C++/maximum-number-of-groups-entering-a-competition.cpp) [Python](./Python/maximum-number-of-groups-entering-a-competition.py)| _O(1)_ | _O(1)_ | Medium | | Constructive Algorithms, Math
2610 | [Convert an Array Into a 2D Array With Conditions](https://leetcode.com/problems/convert-an-array-into-a-2d-array-with-conditions/) | [C++](./C++/convert-an-array-into-a-2d-array-with-conditions.cpp) [Python](./Python/convert-an-array-into-a-2d-array-with-conditions.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Constructive Algorithms
2647 | [Color the Triangle Red](https://leetcode.com/problems/color-the-triangle-red/) | [C++](./C++/color-the-triangle-red.cpp) [Python](./Python/color-the-triangle-red.py) | _O(n^2)_ | _O(1)_ | Hard | š | Constructive Algorithms
2654 | [Minimum Number of Operations to Make All Array Elements Equal to 1](https://leetcode.com/problems/minimum-number-of-operations-to-make-all-array-elements-equal-to-1/) | [C++](./C++/minimum-number-of-operations-to-make-all-array-elements-equal-to-1.cpp) [Python](./Python/minimum-number-of-operations-to-make-all-array-elements-equal-to-1.py) | _O(n^2)_ | _O(1)_ | Medium | | Math, Number Theory, Constructive Algorithms
2728 | [Count Houses in a Circular Street](https://leetcode.com/problems/count-houses-in-a-circular-street/) | [C++](./C++/count-houses-in-a-circular-street.cpp) [Python](./Python/count-houses-in-a-circular-street.py) | _O(k)_ | _O(1)_ | Easy | š | Constructive Algorithms
2732 | [Find a Good Subset of the Matrix](https://leetcode.com/problems/find-a-good-subset-of-the-matrix/) | [C++](./C++/find-a-good-subset-of-the-matrix.cpp) [Python](./Python/find-a-good-subset-of-the-matrix.py) | _O(m * 2^n)_ | _O(2^n)_ | Hard | | Bitmasks, Constructive Algorithms, Greedy
2745 | [Construct the Longest New String](https://leetcode.com/problems/construct-the-longest-new-string/) | [C++](./C++/construct-the-longest-new-string.cpp) [Python](./Python/construct-the-longest-new-string.py) | _O(1)_ | _O(1)_ | Medium | | Constructive Algorithms, Math
2753 | [Count Houses in a Circular Street II](https://leetcode.com/problems/count-houses-in-a-circular-street-ii/) | [C++](./C++/count-houses-in-a-circular-street-ii.cpp) [Python](./Python/count-houses-in-a-circular-street-ii.py) | _O(k)_ | _O(1)_ | Hard | š | Constructive Algorithms
2811 | [Check if it is Possible to Split Array](https://leetcode.com/problems/check-if-it-is-possible-to-split-array/) | [C++](./C++/check-if-it-is-possible-to-split-array.cpp) [Python](./Python/check-if-it-is-possible-to-split-array.py) | _O(n)_ | _O(1)_ | Medium | | Constructive Algorithms
2829 | [Determine the Minimum Sum of a k-avoiding Array](https://leetcode.com/problems/determine-the-minimum-sum-of-a-k-avoiding-array/) | [C++](./C++/determine-the-minimum-sum-of-a-k-avoiding-array.cpp) [Python](./Python/determine-the-minimum-sum-of-a-k-avoiding-array.py) | _O(1)_ | _O(1)_ | Medium | | Greedy, Constructive Algorithms, Math
2834 | [Find the Minimum Possible Sum of a Beautiful Array](https://leetcode.com/problems/find-the-minimum-possible-sum-of-a-beautiful-array/) | [C++](./C++/find-the-minimum-possible-sum-of-a-beautiful-array.cpp) [Python](./Python/find-the-minimum-possible-sum-of-a-beautiful-array.py) | _O(1)_ | _O(1)_ | Medium | [Determine the Minimum Sum of a k-avoiding Array](https://leetcode.com/problems/determine-the-minimum-sum-of-a-k-avoiding-array/) | Greedy, Constructive Algorithms, Math
2849 | [Determine if a Cell Is Reachable at a Given Time](https://leetcode.com/problems/determine-if-a-cell-is-reachable-at-a-given-time/) | [C++](./C++/determine-if-a-cell-is-reachable-at-a-given-time.cpp) [Python](./Python/determine-if-a-cell-is-reachable-at-a-given-time.py) | _O(1)_ | _O(1)_ | Medium | | Constructive Algorithms, Math
2856 | [Minimum Array Length After Pair Removals](https://leetcode.com/problems/minimum-array-length-after-pair-removals/) | [C++](./C++/minimum-array-length-after-pair-removals.cpp) [Python](./Python/minimum-array-length-after-pair-removals.py) | _O(n)_ | _O(n)_ | Medium | | Freq Table, Constructive Algorithms
3139 | [Minimum Cost to Equalize Array](https://leetcode.com/problems/minimum-cost-to-equalize-array/) | [C++](./C++/minimum-cost-to-equalize-array.cpp) [Python](./Python/minimum-cost-to-equalize-array.py) | _O(n)_ | _O(1)_ | Hard | | Constructive Algorithms, Math
3260 | [Find the Largest Palindrome Divisible by K](https://leetcode.com/problems/find-the-largest-palindrome-divisible-by-k/) | [C++](./C++/find-the-largest-palindrome-divisible-by-k.cpp) [Python](./Python/find-the-largest-palindrome-divisible-by-k.py) | _O(n)_ | _O(1)_ | Hard | | String, Constructive Algorithms, Math |
3311 | [Construct 2D Grid Matching Graph Layout](https://leetcode.com/problems/construct-2d-grid-matching-graph-layout/) | [C++](./C++/construct-2d-grid-matching-graph-layout.cpp) [Python](./Python/construct-2d-grid-matching-graph-layout.py) | _O(n)_ | _O(n)_ | Hard | | Graph, Constructive Algorithms, BFS |
3375 | [Minimum Operations to Make Array Values Equal to K](https://leetcode.com/problems/minimum-operations-to-make-array-values-equal-to-k/) | [C++](./C++/minimum-operations-to-make-array-values-equal-to-k.cpp) [Python](./Python/minimum-operations-to-make-array-values-equal-to-k.py) | _O(n)_ | _O(n)_ | Easy | | Hash Table, Constructive Algorithms |
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## Design
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2013 | [Detect Squares](https://leetcode.com/problems/detect-squares/) | [C++](./C++/detect-squares.cpp) [Python](./Python/detect-squares.py) | ctor: _O(1)_<br>add: _O(1)_<br>count: _O(n)_ | _O(n)_| Medium | |
2034 | [Stock Price Fluctuation](https://leetcode.com/problems/stock-price-fluctuation/) | [C++](./C++/stock-price-fluctuation.cpp) [Python](./Python/stock-price-fluctuation.py) | ctor: _O(1)_<br>update: _O(logn)_<br>current: _O(1)_<br>max: _O(1)_<br>min: _O(1)_ | _O(n)_ | Medium | | Sorted List, Heap
2043 | [Simple Bank System](https://leetcode.com/problems/simple-bank-system/) | [C++](./C++/simple-bank-system.cpp) [Python](./Python/simple-bank-system.py) | ctor: _O(1)_<br>transer: _O(1)_<br>deposit: _O(1)_<br>withdraw: _O(1)_ | _O(1)_ | Medium | |
2069 | [Walking Robot Simulation II](https://leetcode.com/problems/walking-robot-simulation-ii/) | [C++](./C++/walking-robot-simulation-ii.cpp) [Python](./Python/walking-robot-simulation-ii.py) | _O(1)_ | _O(1)_ | Medium | | Simulation, Math
2080 | [Range Frequency Queries](https://leetcode.com/problems/range-frequency-queries/) | [C++](./C++/range-frequency-queries.cpp) [Python](./Python/range-frequency-queries.py) | ctor: _O(n)_<br>query: _O(logn)_ | _O(n)_ | Medium | | Binary Search
2102 | [Sequentially Ordinal Rank Tracker](https://leetcode.com/problems/sequentially-ordinal-rank-tracker/) | [C++](./C++/sequentially-ordinal-rank-tracker.cpp) [Python](./Python/sequentially-ordinal-rank-tracker.py) | add: _O(logn)_<br>get: _O(logn)_ | _O(n)_ | Hard | | Sorted List
2166 | [Design Bitset](https://leetcode.com/problems/design-bitset/) | [C++](./C++/design-bitset.cpp) [Python](./Python/design-bitset.py) | ctor: _O(n)_<br>fix: _O(1)_<br>fix: _O(1)_<br>unfix: _O(1)_<br>flip: _O(1)_<br>all: _O(1)_<br>one: _O(1)_<br>count: _O(1)_<br>toString: _O(n)_ | _O(n)_ | Medium | |
2227 | [Encrypt and Decrypt Strings](https://leetcode.com/problems/encrypt-and-decrypt-strings/) | [C++](./C++/encrypt-and-decrypt-strings.cpp) [Python](./Python/encrypt-and-decrypt-strings.py) | ctor: _O(m + d)_<br>encrypt: _O(n)_<br>decrypt: _O(n)_ | _O(n)_ | Hard | | Freq Table
2241 | [Design an ATM Machine](https://leetcode.com/problems/design-an-atm-machine/) | [C++](./C++/design-an-atm-machine.cpp) [Python](./Python/design-an-atm-machine.py) | ctor: _O(1)_<br>deposit: _O(1)_<br>withdraw: _O(1)_ | _O(1)_ | Medium | | Greedy
2254 | [Design Video Sharing Platform](https://leetcode.com/problems/design-video-sharing-platform/) | [C++](./C++/design-video-sharing-platform.cpp) [Python](./Python/design-video-sharing-platform.py) | ctor: _O(1)_<br>upload: _O(logn + l)_<br>remove: _O(logn)_<br>like: _O(1)_<br>dislike: _O(1)_<br>view: _O(1)_<br>getLikesAndDislikes: _O(1)_<br>getViews: _O(1)_ | _O(n * l)_ | Hard | š | Heap
2276 | [Count Integers in Intervals](https://leetcode.com/problems/count-integers-in-intervals/) | [C++](./C++/count-integers-in-intervals.cpp) [Python](./Python/count-integers-in-intervals.py) | ctor: _O(1)_<br>add: _O(logn)_, amortized<br>Count: _O(1)_ | _O(n)_ | Hard | | Sorted List
2286 | [Booking Concert Tickets in Groups](https://leetcode.com/problems/booking-concert-tickets-in-groups/) | [C++](./C++/booking-concert-tickets-in-groups.cpp) [Python](./Python/booking-concert-tickets-in-groups.py) | ctor: _O(n)_<br>gather: _O(logn)_<br>scatter: _O(logn)_, amortized | _O(n)_ | Hard | | Segment Tree, Binary Search
2296 | [Design a Text Editor](https://leetcode.com/problems/design-a-text-editor/) | [C++](./C++/design-a-text-editor.cpp) [Python](./Python/design-a-text-editor.py) | ctor: _O(1)_<br>addText: _O(l)_<br>deleteText: _O(k)_<br>cursorLeft: _O(k)_<br>cursorRight: _O(k)_ | _O(n)_ | Hard | | Stack
2336 | [Smallest Number in Infinite Set](https://leetcode.com/problems/smallest-number-in-infinite-set/) | [C++](./C++/smallest-number-in-infinite-set.cpp) [Python](./Python/smallest-number-in-infinite-set.py) | ctor: _O(1)_<br>popSmallest: _O(logn)_<br>addBack: _O(logn)_ | _O(n)_ | Medium | | Heap, BST
2349 | [Design a Number Container System](https://leetcode.com/problems/design-a-number-container-system/) | [C++](./C++/design-a-number-container-system.cpp) [Python](./Python/design-a-number-container-system.py) | ctor: _O(1)_<br>change: _O(logn)_<br>find: _O(1)_ | _O(n)_ | Medium | | Sorted List, BST
2353 | [Design a Food Rating System](https://leetcode.com/problems/design-a-food-rating-system/) | [C++](./C++/design-a-food-rating-system.cpp) [Python](./Python/design-a-food-rating-system.py) | ctor: _O(nlogn)_<br>changeRating: _O(logn)_<br>highestRated: _O(1)_ | _O(n)_ | Medium | | Sorted List, BST
2408 | [Design SQL](https://leetcode.com/problems/design-sql/) | [C++](./C++/design-sql.cpp) [Python](./Python/design-sql.py) | ctor: _O(t * max_m)_<br>insertRow: _O(m)_<br>deleteRow: _O(1)_<br>selectCell: _O(m)_ | _O(d)_ | Medium | š | Hash Table
2424 | [Longest Uploaded Prefix](https://leetcode.com/problems/longest-uploaded-prefix/) | [C++](./C++/longest-uploaded-prefix.cpp) [Python](./Python/longest-uploaded-prefix.py) | ctor: _O(1)_<br>upload: _O(1)_, amortized <br>longest: _O(1)_ | _O(n)_ | Medium | | Hash Table
2502 | [Design Memory Allocator](https://leetcode.com/problems/design-memory-allocator/) | [C++](./C++/design-memory-allocator.cpp) [Python](./Python/design-memory-allocator.py) | ctor: _O(1)_<br>allocate: _O(logn)_<br>free: _O(logn)_ | _O(n)_ | Medium | | Sorted List
2526 | [Find Consecutive Integers from a Data Stream](https://leetcode.com/problems/find-consecutive-integers-from-a-data-stream/) | [C++](./C++/find-consecutive-integers-from-a-data-stream.cpp) [Python](./Python/find-consecutive-integers-from-a-data-stream.py) | _O(1)_ | _O(1)_ | Medium | | Array
2590 | [Design a Todo List](https://leetcode.com/problems/design-a-todo-list/) | [C++](./C++/design-a-todo-list.cpp) [Python](./Python/design-a-todo-list.py) | ctor: _O(1)_<br>addTask: _O(l + logn)_<br>getAllTasks: _O(r)_<br>getTasksForTag: _O(r * c)_<br>completeTask: _O(l + logn)_ | _O(n * l)_ | Medium | š | BST, Sorted List
2642 | [Design Graph With Shortest Path Calculator](https://leetcode.com/problems/design-graph-with-shortest-path-calculator/) | [C++](./C++/design-graph-with-shortest-path-calculator.cpp) [Python](./Python/design-graph-with-shortest-path-calculator.py) | ctor: _O(\|V\| + \|E\|)_<br>addEdge: _O(1)_<br>shortestPath: _O(\|E\| * log\|V\|)_ | _O(\|E\|)_ | Hard | | `Dijkstra's Algorithm`
2671 | [Frequency Tracker](https://leetcode.com/problems/frequency-tracker/) | [C++](./C++/frequency-tracker.cpp) [Python](./Python/frequency-tracker.py) | ctor: _O(1)_<br>add: _O(1)_<br>deleteOne: _O(1)_<br>hasFrequency: _O(1)_ | _O(min(n, r))_ | Medium | | Freq Table
3242 | [Design Neighbor Sum Service](https://leetcode.com/problems/design-neighbor-sum-service/) | [C++](./C++/design-neighbor-sum-service.cpp) [Python](./Python/design-neighbor-sum-service.py) | ctor: _O(n^2)_<br>adjacentSum: _O(1)_<br>diagonalSum: _O(1)_ | _O(n^2)_ | Easy | | Hash Table
3369 | [Design an Array Statistics Tracker](https://leetcode.com/problems/design-an-array-statistics-tracker/) | [C++](./C++/design-an-array-statistics-tracker.cpp) [Python](./Python/design-an-array-statistics-tracker.py) | ctor: _O(1)_<br>addNumber: _O(logn)_<br>removeFirstAddedNumber: _O(logn)_<br>getMean: _O(1)_<br>getMedian: _O(1)_<br>getMode: _O(1)_ | _O(n)_ | Hard | š | Deque, Freq Table, Sorted List, BST
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## JS
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2618 | [Check if Object Instance of Class](https://leetcode.com/problems/check-if-object-instance-of-class/) | [TypeScript](./TypeScript/check-if-object-instance-of-class.ts) | _O(n)_ | _O(1)_ | Medium | | |
2619 | [Array Prototype Last](https://leetcode.com/problems/array-prototype-last/) | [TypeScript](./TypeScript/array-prototype-last.ts) | _O(1)_ | _O(1)_ | Easy | | |
2620 | [Counter](https://leetcode.com/problems/counter/) | [TypeScript](./TypeScript/counter.ts) | _O(1)_ | _O(1)_ | Easy | | |
2621 | [Sleep](https://leetcode.com/problems/sleep/) | [TypeScript](./TypeScript/sleep.ts) | _O(1)_ | _O(1)_ | Easy | | Promise |
2622 | [Cache With Time Limit](https://leetcode.com/problems/cache-with-time-limit/) | [TypeScript](./TypeScript/cache-with-time-limit.ts) | _O(1)_ | _O(1)_ | Medium | | Hash Table |
2623 | [Memoize](https://leetcode.com/problems/memoize/) | [TypeScript](./TypeScript/memoize.ts) | _O(1)_ | _O(1)_ | Medium | | Hash Table |
2624 | [Snail traversal](https://leetcode.com/problems/snail-traversal/) | [TypeScript](./TypeScript/snail-traversal.ts) | _O(m * n)_ | _O(1)_ | Medium | | |
2625 | [Flatten Deeply Nested Array](https://leetcode.com/problems/flatten-deeply-nested-array/) | [TypeScript](./TypeScript/flatten-deeply-nested-array.ts) | _O(n)_ | _O(h)_ | Medium | | DFS |
2626 | [Array Reduce Transformation](https://leetcode.com/problems/array-reduce-transformation/) | [TypeScript](./TypeScript/array-reduce-transformation.ts) | _O(n)_ | _O(1)_ | Easy | | |
2627 | [Debounce](https://leetcode.com/problems/debounce/) | [TypeScript](./TypeScript/debounce.ts) | _O(1)_ | _O(1)_ | Medium | | |
2628 | [JSON Deep Equal](https://leetcode.com/problems/json-deep-equal/) | [TypeScript](./TypeScript/json-deep-equal.ts) | _O(n)_ | _O(h)_ | Medium | | DFS |
2629 | [Function Composition](https://leetcode.com/problems/function-composition/) | [TypeScript](./TypeScript/function-composition.ts) | _O(n)_ | _O(1)_ | Easy | | |
2630 | [Memoize II](https://leetcode.com/problems/memoize-ii/) | [TypeScript](./TypeScript/memoize-ii.ts) | _O(n)_ | _O(t)_ | Hard | | Trie |
2631 | [Group By](https://leetcode.com/problems/group-by/) | [TypeScript](./TypeScript/group-by.ts) | _O(n)_ | _O(1)_ | Medium | | |
2632 | [Curry](https://leetcode.com/problems/curry/) | [TypeScript](./TypeScript/curry.ts) | _O(n)_ | _O(n)_ | Medium | | |
2633 | [Convert Object to JSON String](https://leetcode.com/problems/convert-object-to-json-string/) | [TypeScript](./TypeScript/convert-object-to-json-string.ts) | _O(n)_ | _O(h)_ | Medium | | DFS |
2634 | [Filter Elements from Array](https://leetcode.com/problems/filter-elements-from-array/) | [TypeScript](./TypeScript/filter-elements-from-array.ts) | _O(n)_ | _O(1)_ | Easy | | |
2635 | [Apply Transform Over Each Element in Array](https://leetcode.com/problems/apply-transform-over-each-element-in-array/) | [TypeScript](./TypeScript/apply-transform-over-each-element-in-array.ts) | _O(n)_ | _O(1)_ | Easy | | |
2636 | [Promise Pool](https://leetcode.com/problems/promise-pool/) | [TypeScript](./TypeScript/promise-pool.ts) | _O(c + n / c)_ | _O(c)_ | Medium | | Promise |
2637 | [Promise Time Limit](https://leetcode.com/problems/promise-time-limit/) | [TypeScript](./TypeScript/promise-time-limit.ts) | _O(n)_ | _O(1)_ | Easy | | Promise |
2648 | [Generate Fibonacci Sequence](https://leetcode.com/problems/generate-fibonacci-sequence/) | [TypeScript](./TypeScript/generate-fibonacci-sequence.ts) | _O(1)_ | _O(1)_ | Easy | | DP |
2649 | [Nested Array Generator](https://leetcode.com/problems/nested-array-generator/) | [TypeScript](./TypeScript/nested-array-generator.ts) | _O(1)_ | _O(d)_ | Medium | | DFS |
2650 | [Design Cancellable Function](https://leetcode.com/problems/design-cancellable-function/) | [TypeScript](./TypeScript/design-cancellable-function.ts) | _O(1)_ | _O(1)_ | Hard | | Promise |
2665 | [Counter II](https://leetcode.com/problems/counter-ii/) | [TypeScript](./TypeScript/counter-ii.ts) | ctor: _O(1)_<br>increment: _O(1)_<br>decrement: _O(1)_<br>reset: _O(1)_ | _O(1)_ | Easy | | |
2666 | [Allow One Function Call](https://leetcode.com/problems/allow-one-function-call/) | [TypeScript](./TypeScript/allow-one-function-call.ts) | _O(1)_ | _O(1)_ | Easy | | |
2667 | [Create Hello World Function](https://leetcode.com/problems/create-hello-world-function/) | [TypeScript](./TypeScript/create-hello-world-function.ts) | _O(1)_ | _O(1)_ | Easy | | |
2675 | [Array of Objects to Matrix](https://leetcode.com/problems/array-of-objects-to-matrix/) | [TypeScript](./TypeScript/array-of-objects-to-matrix.ts) | _O(l * mlogm + m * n)_ | _O(l * m + m * n)_ | Medium | | DFS |
2676 | [Throttle](https://leetcode.com/problems/throttle/) | [TypeScript](./TypeScript/throttle.ts) | _O(1)_ | _O(1)_ | Medium | | |
2677 | [Chunk Array](https://leetcode.com/problems/chunk-array/) | [TypeScript](./TypeScript/chunk-array.ts) | _O(n)_ | _O(1)_ | Easy | | |
2690 | [Infinite Method Object](https://leetcode.com/problems/infinite-method-object/) | [TypeScript](./TypeScript/infinite-method-object.ts) | _O(1)_ | _O(1)_ | Medium | š | Proxy |
2691 | [Immutability Helper](https://leetcode.com/problems/immutability-helper/) | [TypeScript](./TypeScript/immutability-helper.ts) | _O(1)_ | _O(1)_ | Hard | š | Proxy |
2692 | [Make Object Immutable](https://leetcode.com/problems/make-object-immutable/) | [TypeScript](./TypeScript/make-object-immutable.ts) | _O(1)_ | _O(1)_ | Medium | š | Proxy |
2693 | [Call Function with Custom Context](https://leetcode.com/problems/call-function-with-custom-context/) | [TypeScript](./TypeScript/call-function-with-custom-context.ts) | _O(1)_ | _O(1)_ | Medium | | Symbol |
2694 | [Event Emitter](https://leetcode.com/problems/event-emitter/) | [TypeScript](./TypeScript/event-emitter.ts) | subscribe: _O(1)_<br>unsubscribe: _O(1)_<br>emit: _O(n)_ | _O(n)_ | Medium | | Ordered Set |
2695 | [Array Wrapper](https://leetcode.com/problems/array-wrapper/) | [TypeScript](./TypeScript/array-wrapper.ts) | valueOf: _O(n)_<br>toString: _O(n)_ | _O(1)_ | Easy | | |
2700 | [Differences Between Two Objects](https://leetcode.com/problems/differences-between-two-objects/) | [TypeScript](./TypeScript/differences-between-two-objects.ts) | _O(n)_ | _O(h)_ | Medium | | DFS |
2703 | [Return Length of Arguments Passed](https://leetcode.com/problems/return-length-of-arguments-passed/) | [TypeScript](./TypeScript/return-length-of-arguments-passed.ts) | _O(1)_ | _O(1)_ | Easy | | |
2704 | [To Be Or Not To Be](https://leetcode.com/problems/to-be-or-not-to-be/) | [TypeScript](./TypeScript/to-be-or-not-to-be.ts) | _O(1)_ | _O(1)_ | Easy | | |
2705 | [Compact Object](https://leetcode.com/problems/compact-object/) | [TypeScript](./TypeScript/compact-object.ts) | _O(n)_ | _O(h)_ | Medium | | DFS |
2715 | [Execute Cancellable Function With Delay](https://leetcode.com/problems/execute-cancellable-function-with-delay/) | [TypeScript](./TypeScript/execute-cancellable-function-with-delay.ts) | _O(1)_ | _O(1)_ | Easy | | |
2721 | [Execute Asynchronous Functions in Parallel](https://leetcode.com/problems/execute-asynchronous-functions-in-parallel/) | [TypeScript](./TypeScript/execute-asynchronous-functions-in-parallel.ts) | _O(n)_ | _O(n)_ | Medium | | Promise |
2722 | [Join Two Arrays by ID](https://leetcode.com/problems/join-two-arrays-by-id/) | [TypeScript](./TypeScript/join-two-arrays-by-id.ts) | _O(mlogm + nlogn)_ | _O(1)_ | Medium | | Sort, Two Pointers |
2723 | [Add Two Promises](https://leetcode.com/problems/add-two-promises/) | [TypeScript](./TypeScript/add-two-promises.ts) | _O(1)_ | _O(1)_ | Easy | | Promise |
2724 | [Sort By](https://leetcode.com/problems/sort-by/) | [TypeScript](./TypeScript/sort-by.ts) | _O(nlogn)_ | _O(1)_ | Easy | | Sort |
2725 | [Interval Cancellation](https://leetcode.com/problems/interval-cancellation/) | [TypeScript](./TypeScript/interval-cancellation.ts) | _O(1)_ | _O(1)_ | Easy | | |
2726 | [Calculator with Method Chaining](https://leetcode.com/problems/calculator-with-method-chaining/) | [TypeScript](./TypeScript/calculator-with-method-chaining.ts) | _O(1)_ | _O(1)_ | Easy | | |
2727 | [Is Object Empty](https://leetcode.com/problems/is-object-empty/) | [TypeScript](./TypeScript/is-object-empty.ts) | _O(1)_ | _O(1)_ | Easy | | |
2754 | [Bind Function to Context](https://leetcode.com/problems/bind-function-to-context/) | [TypeScript](./TypeScript/bind-function-to-context.ts) | _O(1)_ | _O(1)_ | Medium | š | Symbol |
2755 | [Deep Merge of Two Objects](https://leetcode.com/problems/deep-merge-of-two-objects/) | [TypeScript](./TypeScript/deep-merge-of-two-objects.ts) | _O(n + m)_ | _O(h)_ | Medium | š | DFS |
2756 | [Query Batching](https://leetcode.com/problems/query-batching/) | [TypeScript](./TypeScript/query-batching.ts) | _O(n)_ | _O(n)_ | Hard | š | |
2757 | [Generate Circular Array Values](https://leetcode.com/problems/generate-circular-array-values/) | [TypeScript](./TypeScript/generate-circular-array-values.ts) | _O(1)_ | _O(1)_ | Medium | š | Generator |
2758 | [Next Day](https://leetcode.com/problems/next-day/) | [TypeScript](./TypeScript/next-day.ts) | _O(1)_ | _O(1)_ | Easy | š | |
2759 | [Convert JSON String to Object](https://leetcode.com/problems/convert-json-string-to-object/) | [TypeScript](./TypeScript/convert-json-string-to-object.ts) | _O(n)_ | _O(h)_ | Hard | š | Stack |
2774 | [Array Upper Bound](https://leetcode.com/problems/array-upper-bound/) | [TypeScript](./TypeScript/array-upper-bound.ts) | _O(logn)_ | _O(1)_ | Easy | š | Binary Search |
2775 | [Undefined to Null](https://leetcode.com/problems/undefined-to-null/) | [TypeScript](./TypeScript/undefined-to-null.ts) | _O(n)_ | _O(h)_ | Medium | š | DFS |
2776 | [Convert Callback Based Function to Promise Based Function](https://leetcode.com/problems/convert-callback-based-function-to-promise-based-function/) | [TypeScript](./TypeScript/convert-callback-based-function-to-promise-based-function.ts) | _O(1)_ | _O(1)_ | Medium | š | Promise |
2777 | [Date Range Generator](https://leetcode.com/problems/date-range-generator/) | [TypeScript](./TypeScript/date-range-generator.ts) | _O(1)_ | _O(1)_ | Medium | š | Generator |
2794 | [Create Object from Two Arrays](https://leetcode.com/problems/create-object-from-two-arrays/) | [TypeScript](./TypeScript/create-object-from-two-arrays.ts) | _O(n)_ | _O(1)_ | Easy | š | |
2795 | [Parallel Execution of Promises for Individual Results Retrieval](https://leetcode.com/problems/parallel-execution-of-promises-for-individual-results-retrieval/) | [TypeScript](./TypeScript/parallel-execution-of-promises-for-individual-results-retrieval.ts) | _O(n)_ | _O(n)_ | Medium | š | Promise |
2796 | [Repeat String](https://leetcode.com/problems/repeat-string/) | [TypeScript](./TypeScript/repeat-string.ts) | _O(n * t)_ | _O(n * t)_ | Easy | š | String |
2797 | [Partial Function with Placeholders](https://leetcode.com/problems/partial-function-with-placeholders/) | [TypeScript](./TypeScript/partial-function-with-placeholders.ts) | _O(n)_ | _O(n)_ | Medium | š | |
2803 | [Factorial Generator](https://leetcode.com/problems/factorial-generator/) | [TypeScript](./TypeScript/factorial-generator.ts) | _O(n)_ | _O(1)_ | Easy |š| Generator |
2804 | [Array Prototype ForEach](https://leetcode.com/problems/array-prototype-foreach/) | [TypeScript](./TypeScript/array-prototype-foreach.ts) | _O(n)_ | _O(1)_ | Easy |š| Symbol |
2805 | [Custom Interval](https://leetcode.com/problems/custom-interval/) | [TypeScript](./TypeScript/custom-interval.ts) | _O(1)_ | _O(1)_ | Medium |š| |
2821 | [Delay the Resolution of Each Promise](https://leetcode.com/problems/delay-the-resolution-of-each-promise/) | [TypeScript](./TypeScript/delay-the-resolution-of-each-promise.ts) | _O(1)_ | _O(1)_ | Easy |š| Promise |
2822 | [Inversion of Object](https://leetcode.com/problems/inversion-of-object/) | [TypeScript](./TypeScript/inversion-of-object.ts) | _O(n)_ | _O(1)_ | Easy |š| |
2823 | [Deep Object Filter](https://leetcode.com/problems/deep-object-filter/) | [TypeScript](./TypeScript/deep-object-filter.ts) | _O(n)_ | _O(h)_ | Medium |š| DFS |
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
## SQL
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2004 | [The Number of Seniors and Juniors to Join the Company](https://leetcode.com/problems/the-number-of-seniors-and-juniors-to-join-the-company/) | [MySQL](./MySQL/the-number-of-seniors-and-juniors-to-join-the-company.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
2010 | [The Number of Seniors and Juniors to Join the Company II](https://leetcode.com/problems/the-number-of-seniors-and-juniors-to-join-the-company-ii/) | [MySQL](./MySQL/the-number-of-seniors-and-juniors-to-join-the-company.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
2020 | [Number of Accounts That Did Not Stream](https://leetcode.com/problems/number-of-accounts-that-did-not-stream/) | [MySQL](./MySQL/number-of-accounts-that-did-not-stream.sql) | _O(m + n)_ | _O(m + n)_ | Medium |š||
2026 | [Low-Quality Problems](https://leetcode.com/problems/low-quality-problems/) | [MySQL](./MySQL/low-quality-problems.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2041 | [Accepted Candidates From the Interviews](https://leetcode.com/problems/accepted-candidates-from-the-interviews/) | [MySQL](./MySQL/accepted-candidates-from-the-interviews.sql) | _O(m + n)_ | _O(m + n)_ | Medium |š||
2051 | [The Category of Each Member in the Store](https://leetcode.com/problems/the-category-of-each-member-in-the-store/) | [MySQL](./MySQL/the-category-of-each-member-in-the-store.sql) | _O(m + n)_ | _O(m + n)_ | Medium |š||
2066 | [Account Balance](https://leetcode.com/problems/account-balance/) | [MySQL](./MySQL/account-balance.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2072 | [The Winner University](https://leetcode.com/problems/the-winner-university/) | [MySQL](./MySQL/the-winner-university.sql) | _O(n)_ | _O(n)_ | Easy |š||
2082 | [The Number of Rich Customers](https://leetcode.com/problems/the-number-of-rich-customers/) | [MySQL](./MySQL/the-number-of-rich-customers.sql) | _O(n)_ | _O(n)_ | Easy |š||
2084 | [Drop Type 1 Orders for Customers With Type 0 Orders](https://leetcode.com/problems/drop-type-1-orders-for-customers-with-type-0-orders/) | [MySQL](./MySQL/drop-type-1-orders-for-customers-with-type-0-orders.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2112 | [The Airport With the Most Traffic](https://leetcode.com/problems/the-airport-with-the-most-traffic/) | [MySQL](./MySQL/the-airport-with-the-most-traffic.sql) | _O(n)_ | _O(n)_ | Medium |š||
2118 | [Build the Equation](https://leetcode.com/problems/build-the-equation/) | [MySQL](./MySQL/build-the-equation.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
2142 | [The Number of Passengers in Each Bus I](https://leetcode.com/problems/the-number-of-passengers-in-each-bus-i/) | [MySQL](./MySQL/the-number-of-passengers-in-each-bus-i.sql) | _O(p * b + blogb)_ | _O(p * b)_ | Medium |š||
2153 | [The Number of Passengers in Each Bus II](https://leetcode.com/problems/the-number-of-passengers-in-each-bus-ii/) | [MySQL](./MySQL/the-number-of-passengers-in-each-bus-ii.sql) | _O(p * b + blogb)_ | _O(p * b)_ | Hard |š||
2159 | [Order Two Columns Independently](https://leetcode.com/problems/order-two-columns-independently/) | [MySQL](./MySQL/order-two-columns-independently.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2173 | [Longest Winning Streak](https://leetcode.com/problems/longest-winning-streak/) | [MySQL](./MySQL/longest-winning-streak.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
2175 | [The Change in Global Rankings](https://leetcode.com/problems/the-change-in-global-rankings/) | [MySQL](./MySQL/the-change-in-global-rankings.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2199 | [Finding the Topic of Each Post](https://leetcode.com/problems/finding-the-topic-of-each-post/) | [MySQL](./MySQL/finding-the-topic-of-each-post.sql) | _O(n * mlogm)_ | _O(n * m)_ | Hard |š||
2205 | [The Number of Users That Are Eligible for Discount](https://leetcode.com/problems/the-number-of-users-that-are-eligible-for-discount/) | [MySQL](./MySQL/the-number-of-users-that-are-eligible-for-discount.sql) | _O(n)_ | _O(n)_ | Easy |š||
2228 | [Users With Two Purchases Within Seven Days](https://leetcode.com/problems/users-with-two-purchases-within-seven-days/) | [MySQL](./MySQL/users-with-two-purchases-within-seven-days.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2230 | [The Users That Are Eligible for Discount](https://leetcode.com/problems/the-users-that-are-eligible-for-discount/) | [MySQL](./MySQL/the-users-that-are-eligible-for-discount.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2238 | [Number of Times a Driver Was a Passenger](https://leetcode.com/problems/number-of-times-a-driver-was-a-passenger/) | [MySQL](./MySQL/number-of-times-a-driver-was-a-passenger.sql) | _O(n)_ | _O(n)_ | Medium |š||
2252 | [Dynamic Pivoting of a Table](https://leetcode.com/problems/dynamic-pivoting-of-a-table/) | [MySQL](./MySQL/dynamic-pivoting-of-a-table.sql) | _O(n * m)_ | _O(n * m)_ | Hard |š||
2253 | [Dynamic Unpivoting of a Table](https://leetcode.com/problems/dynamic-unpivoting-of-a-table/) | [MySQL](./MySQL/dynamic-unpivoting-of-a-table.sql) | _O(n * m)_ | _O(n * m)_ | Hard |š||
2292 | [Products With Three or More Orders in Two Consecutive Years](https://leetcode.com/problems/products-with-three-or-more-orders-in-two-consecutive-years/) | [MySQL](./MySQL/products-with-three-or-more-orders-in-two-consecutive-years.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2298 | [Tasks Count in the Weekend](https://leetcode.com/problems/tasks-count-in-the-weekend/) | [MySQL](./MySQL/tasks-count-in-the-weekend.sql) | _O(n)_ | _O(n)_ | Medium |š||
2308 | [Arrange Table by Gender](https://leetcode.com/problems/arrange-table-by-gender/) | [MySQL](./MySQL/arrange-table-by-gender.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2314 | [The First Day of the Maximum Recorded Degree in Each City](https://leetcode.com/problems/the-first-day-of-the-maximum-recorded-degree-in-each-city/) | [MySQL](./MySQL/the-first-day-of-the-maximum-recorded-degree-in-each-city.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2324 | [Product Sales Analysis IV](https://leetcode.com/problems/product-sales-analysis-iv/) | [MySQL](./MySQL/product-sales-analysis-iv.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2329 | [Product Sales Analysis V](https://leetcode.com/problems/product-sales-analysis-v/) | [MySQL](./MySQL/product-sales-analysis-v.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2339 | [All the Matches of the League](https://leetcode.com/problems/all-the-matches-of-the-league/) | [MySQL](./MySQL/all-the-matches-of-the-league.sql) | _O(n^2)_ | _O(n^2)_ | Easy |š||
2346 | [Compute the Rank as a Percentage](https://leetcode.com/problems/compute-the-rank-as-a-percentage/) | [MySQL](./MySQL/compute-the-rank-as-a-percentage.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2356 | [Number of Unique Subjects Taught by Each Teacher](https://leetcode.com/problems/number-of-unique-subjects-taught-by-each-teacher/) | [MySQL](./MySQL/number-of-unique-subjects-taught-by-each-teacher.sql) | _O(n)_ | _O(n)_ | Easy |š||
2362 | [Generate the Invoice](https://leetcode.com/problems/generate-the-invoice/) | [MySQL](./MySQL/generate-the-invoice.sql) | _O(m + nlogn)_ | _O(n + m)_ | Hard |š||
2372 | [Calculate the Influence of Each Salesperson](https://leetcode.com/problems/calculate-the-influence-of-each-salesperson/) | [MySQL](./MySQL/calculate-the-influence-of-each-salesperson.sql) | _O(sp + c + s)_ | _O(sp + c + s)_ | Medium |š||
2377 | [Sort the Olympic Table](https://leetcode.com/problems/sort-the-olympic-table/) | [MySQL](./MySQL/sort-the-olympic-table.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2388 | [Change Null Values in a Table to the Previous Value](https://leetcode.com/problems/change-null-values-in-a-table-to-the-previous-value/) | [MySQL](./MySQL/change-null-values-in-a-table-to-the-previous-value.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2394 | [Employees With Deductions](https://leetcode.com/problems/employees-with-deductions/) | [MySQL](./MySQL/employees-with-deductions.sql) | _O(n)_ | _O(n)_ | Medium |š||
2474 | [Customers With Strictly Increasing Purchases](https://leetcode.com/problems/customers-with-strictly-increasing-purchases/) | [MySQL](./MySQL/customers-with-strictly-increasing-purchases.sql) | _O(n)_ | _O(n)_ | Hard |š||
2480 | [Form a Chemical Bond](https://leetcode.com/problems/form-a-chemical-bond/) | [MySQL](./MySQL/form-a-chemical-bond.sql) | _O(n^2)_ | _O(n)_ | Easy |š||
2494 | [Merge Overlapping Events in the Same Hall](https://leetcode.com/problems/merge-overlapping-events-in-the-same-hall/) | [MySQL](./MySQL/merge-overlapping-events-in-the-same-hall.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
2504 | [Concatenate the Name and the Profession](https://leetcode.com/problems/concatenate-the-name-and-the-profession/) | [MySQL](./MySQL/concatenate-the-name-and-the-profession.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2668 | [Find Latest Salaries](https://leetcode.com/problems/find-latest-salaries/) | [MySQL](./MySQL/find-latest-salaries.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2669 | [Count Artist Occurrences On Spotify Ranking List](https://leetcode.com/problems/count-artist-occurrences-on-spotify-ranking-list/) | [MySQL](./MySQL/count-artist-occurrences-on-spotify-ranking-list.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2686 | [Immediate Food Delivery III](https://leetcode.com/problems/immediate-food-delivery-iii/) | [MySQL](./MySQL/immediate-food-delivery-iii.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2687 | [Bikes Last Time Used](https://leetcode.com/problems/bikes-last-time-used/) | [MySQL](./MySQL/bikes-last-time-used.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2688 | [Find Active Users](https://leetcode.com/problems/find-active-users/) | [MySQL](./MySQL/find-active-users.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2701 | [Consecutive Transactions with Increasing Amounts](https://leetcode.com/problems/consecutive-transactions-with-increasing-amounts/) | [MySQL](./MySQL/consecutive-transactions-with-increasing-amounts.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
2720 | [Popularity Percentage](https://leetcode.com/problems/popularity-percentage/) | [MySQL](./MySQL/popularity-percentage.sql) | _O(n^2)_ | _O(n^2)_ | Hard |š||
2738 | [Count Occurrences in Text](https://leetcode.com/problems/count-occurrences-in-text/) | [MySQL](./MySQL/count-occurrences-in-text.sql) | _O(n)_ | _O(n)_ | Medium |š||
2752 | [Customers with Maximum Number of Transactions on Consecutive Days](https://leetcode.com/problems/customers-with-maximum-number-of-transactions-on-consecutive-days/) | [MySQL](./MySQL/customers-with-maximum-number-of-transactions-on-consecutive-days.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
2783 | [Flight Occupancy and Waitlist Analysis](https://leetcode.com/problems/flight-occupancy-and-waitlist-analysis/) | [MySQL](./MySQL/flight-occupancy-and-waitlist-analysis.sql) | _O(n * m + nlogn)_ | _O(n * m)_ | Medium |š||
2793 | [Status of Flight Tickets](https://leetcode.com/problems/status-of-flight-tickets/) | [MySQL](./MySQL/status-of-flight-tickets.sql) | _O(nlogn + m)_ | _O(n + m)_ | Hard |š||
2820 | [Election Results](https://leetcode.com/problems/election-results/) | [MySQL](./MySQL/election-results.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2837 | [Total Traveled Distance](https://leetcode.com/problems/election-results/) | [MySQL](./MySQL/total-traveled-distance.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2853 | [Highest Salaries Difference](https://leetcode.com/problems/highest-salaries-difference/) | [MySQL](./MySQL/highest-salaries-difference.sql) | _O(n)_ | _O(n)_ | Easy |š||
2854 | [Rolling Average Steps](https://leetcode.com/problems/rolling-average-steps/) | [MySQL](./MySQL/rolling-average-steps.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2893 | [Calculate Orders Within Each Interval](https://leetcode.com/problems/calculate-orders-within-each-interval/) | [MySQL](./MySQL/calculate-orders-within-each-interval.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2922 | [Market Analysis III](https://leetcode.com/problems/market-analysis-iii/) | [MySQL](./MySQL/market-analysis-iii.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2978 | [Symmetric Coordinates](https://leetcode.com/problems/symmetric-coordinates/) | [MySQL](./MySQL/symmetric-coordinates.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2984 | [Find Peak Calling Hours for Each City](https://leetcode.com/problems/find-peak-calling-hours-for-each-city/) | [MySQL](./MySQL/find-peak-calling-hours-for-each-city.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2985 | [Calculate Compressed Mean](https://leetcode.com/problems/calculate-compressed-mean/) | [MySQL](./MySQL/calculate-compressed-mean.sql) | _O(n)_ | _O(n)_ | Easy |š||
2986 | [Find Third Transaction](https://leetcode.com/problems/find-third-transaction/) | [MySQL](./MySQL/find-third-transaction.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2987 | [Find Expensive Cities](https://leetcode.com/problems/find-expensive-cities/) | [MySQL](./MySQL/find-expensive-cities.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2988 | [Manager of the Largest Department](https://leetcode.com/problems/manager-of-the-largest-department/) | [MySQL](./MySQL/manager-of-the-largest-department.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2989 | [Class Performance](https://leetcode.com/problems/class-performance/) | [MySQL](./MySQL/class-performance.sql) | _O(n)_ | _O(n)_ | Medium |š||
2990 | [Loan Types](https://leetcode.com/problems/loan-types/) | [MySQL](./MySQL/loan-types.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
2991 | [Top Three Wineries](https://leetcode.com/problems/top-three-wineries/) | [MySQL](./MySQL/top-three-wineries.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
2993 | [Friday Purchases I](https://leetcode.com/problems/friday-purchases-i/) | [MySQL](./MySQL/friday-purchases-i.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
2994 | [Friday Purchases II](https://leetcode.com/problems/friday-purchases-ii/) | [MySQL](./MySQL/friday-purchases-ii.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
2995 | [Viewers Turned Streamers](https://leetcode.com/problems/viewers-turned-streamers/) | [MySQL](./MySQL/viewers-turned-streamers.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
3050 | [Pizza Toppings Cost Analysis](https://leetcode.com/problems/pizza-toppings-cost-analysis/) | [MySQL](./MySQL/pizza-toppings-cost-analysis.sql) | _O(n^3 * logn)_ | _O(n^3)_ | Medium |š||
3051 | [Find Candidates for Data Scientist Position](https://leetcode.com/problems/find-candidates-for-data-scientist-position/) | [MySQL](./MySQL/find-candidates-for-data-scientist-position.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
3052 | [Maximize Items](https://leetcode.com/problems/maximize-items/) | [MySQL](./MySQL/maximize-items.sql) | _O(n)_ | _O(n)_ | Hard |š||
3053 | [Classifying Triangles by Lengths](https://leetcode.com/problems/classifying-triangles-by-lengths/) | [MySQL](./MySQL/classifying-triangles-by-lengths.sql) | _O(n)_ | _O(n)_ | Easy |š||
3054 | [Binary Tree Nodes](https://leetcode.com/problems/binary-tree-nodes/) | [MySQL](./MySQL/binary-tree-nodes.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
3055 | [Top Percentile Fraud](https://leetcode.com/problems/top-percentile-fraud/) | [MySQL](./MySQL/top-percentile-fraud.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
3056 | [Snaps Analysis](https://leetcode.com/snaps-analysis/) | [MySQL](./MySQL/snaps-analysis.sql) | _O(n)_ | _O(n)_ | Medium |š||
3057 | [Employees Project Allocation](https://leetcode.com/problems/employees-project-allocation/) | [MySQL](./MySQL/employees-project-allocation.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
3058 | [Friends With No Mutual Friends](https://leetcode.com/problems/friends-with-no-mutual-friends/) | [MySQL](./MySQL/friends-with-no-mutual-friends.sql) | _O(n^2 * logn)_ | _O(n^2)_ | Medium |š||
3059 | [Find All Unique Email Domains](https://leetcode.com/problems/find-all-unique-email-domains/) | [MySQL](./MySQL/find-all-unique-email-domains.sql) | _O(nlogn)_ | _O(n)_ | Easy |š||
3060 | [User Activities within Time Bounds](https://leetcode.com/problems/user-activities-within-time-bounds/) | [MySQL](./MySQL/user-activities-within-time-bounds.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
3061 | [Calculate Trapping Rain Water](https://leetcode.com/problems/calculate-trapping-rain-water/) | [MySQL](./MySQL/calculate-trapping-rain-water.sql) | _O(nlogn)_ | _O(n)_ | Hard |š||
3087 | [Find Trending Hashtags](https://leetcode.com/problems/find-trending-hashtags/) | [MySQL](./MySQL/find-trending-hashtags.sql) | _O(nlogn)_ | _O(n)_ | Medium |š||
3089 | [Find Bursty Behavior](https://leetcode.com/problems/find-bursty-behavior/) | [MySQL](./MySQL/find-bursty-behavior.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| Window Function |
3103 | [Find Trending Hashtags II](https://leetcode.com/problems/find-trending-hashtags-ii/) | [MySQL](./MySQL/find-trending-hashtags-ii.sql) | _O(n * l^2 + (n * l) * log(n * l))_ | _O(n * l^2)_ | Hard |š| Recursive CTE |
3118 | [Friday Purchase III](https://leetcode.com/problems/friday-purchase-iii/) | [MySQL](./MySQL/friday-purchase-iii.sql) | _O(n)_ | _O(n)_ | Medium |š||
3124 | [Find Longest Calls](https://leetcode.com/problems/find-longest-calls/) | [MySQL](./MySQL/find-longest-calls.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| Window Function |
3126 | [Server Utilization Time](https://leetcode.com/problems/server-utilization-time/) | [MySQL](./MySQL/server-utilization-time.sql) | _O(nlogn)_ | _O(n)_ | Medium || Window Function |
3140 | [Consecutive Available Seats II](https://leetcode.com/problems/consecutive-available-seats-ii/) | [MySQL](./MySQL/consecutive-available-seats-ii.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| Window Function |
3150 | [Invalid Tweets II](https://leetcode.com/problems/invalid-tweets-ii/) | [MySQL](./MySQL/invalid-tweets-ii.sql) | _O(n * l + nlogn)_ | _O(n * l)_ | Easy |š| String |
3156 | [Employee Task Duration and Concurrent Tasks](https://leetcode.com/problems/employee-task-duration-and-concurrent-tasks/) | [MySQL](./MySQL/employee-task-duration-and-concurrent-tasks.sql) | _O(nlogn)_ | _O(n)_ | Hard |š| Line Sweep |
3166 | [Calculate Parking Fees and Duration](https://leetcode.com/problems/calculate-parking-fees-and-duration/) | [MySQL](./MySQL/calculate-parking-fees-and-duration.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| |
3172 | [Second Day Verification](https://leetcode.com/problems/second-day-verification/) | [MySQL](./MySQL/second-day-verification.sql) | _O(nlogn)_ | _O(n)_ | Easy |š| |
3182 | [Find Top Scoring Students](https://leetcode.com/problems/find-top-scoring-students/) | [MySQL](./MySQL/find-top-scoring-students.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| |
3188 | [Find Top Scoring Students II](https://leetcode.com/problems/find-top-scoring-students-ii/) | [MySQL](./MySQL/find-top-scoring-students-ii.sql) | _O(nlogn)_ | _O(n)_ | Hard |š| |
3198 | [Find Cities in Each State](https://leetcode.com/problems/find-cities-in-each-state/) | [MySQL](./MySQL/find-cities-in-each-state.sql) | _O(nlogn)_ | _O(n)_ | Easy |š| |
3204 | [Bitwise User Permissions Analysis](https://leetcode.com/problems/bitwise-user-permissions-analysis/) | [MySQL](./MySQL/bitwise-user-permissions-analysis.sql) | _O(n)_ | _O(n)_ | Medium |š| |
3214 | [Year on Year Growth Rate](https://leetcode.com/problems/year-on-year-growth-rate/) | [MySQL](./MySQL/year-on-year-growth-rate.sql) | _O(nlogn)_ | _O(n)_ | Hard |š| Window Function |
3220 | [Odd and Even Transactions](https://leetcode.com/problems/odd-and-even-transactions/) | [MySQL](./MySQL/odd-and-even-transactions.sql) | _O(nlogn)_ | _O(n)_ | Medium || |
3230 | [Customer Purchasing Behavior Analysis](https://leetcode.com/problems/customer-purchasing-behavior-analysis/) | [MySQL](./MySQL/customer-purchasing-behavior-analysis.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| Window Function |
3236 | [CEO Subordinate Hierarchy](https://leetcode.com/problems/ceo-subordinate-hierarchy/) | [MySQL](./MySQL/ceo-subordinate-hierarchy.sql) | _O(nlogn)_ | _O(n)_ | Hard |š| Recursive CTE, BFS |
3246 | [Premier League Table Ranking](https://leetcode.com/problems/premier-league-table-ranking/) | [MySQL](./MySQL/premier-league-table-ranking.sql) | _O(nlogn)_ | _O(n)_ | Easy |š| Window Function |
3252 | [Premier League Table Ranking II](https://leetcode.com/problems/premier-league-table-ranking-ii/) | [MySQL](./MySQL/premier-league-table-ranking-ii.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| Window Function |
3262 | [Find Overlapping Shifts](https://leetcode.com/problems/find-overlapping-shifts/) | [MySQL](./MySQL/find-overlapping-shifts.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| Line Sweep |
3268 | [Find Overlapping Shifts II](https://leetcode.com/problems/find-overlapping-shifts-ii/) | [MySQL](./MySQL/find-overlapping-shifts-ii.sql) | _O(n^2)_ | _O(n^2)_ | Hard |š| Line Sweep, Window Function, Combinatorics |
3278 | [Find Candidates for Data Scientist Position II](https://leetcode.com/problems/find-candidates-for-data-scientist-position-ii/) | [MySQL](./MySQL/find-candidates-for-data-scientist-position-ii.sql) | _O(p * s * n + p * nlogn + plogp)_ | _O(p * s * n)_ | Medium |š| Window Function |
3293 | [Calculate Product Final Price](https://leetcode.com/problems/calculate-product-final-price/) | [MySQL](./MySQL/calculate-product-final-price.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| |
3308 | [Find Top Performing Driver](https://leetcode.com/problems/find-top-performing-driver/) | [MySQL](./MySQL/find-top-performing-driver.sql) | _O(tlogt)_ | _O(t)_ | Medium |š| Window Function |
3322 | [Premier League Table Ranking III](https://leetcode.com/problems/premier-league-table-ranking-iii/) | [MySQL](./MySQL/premier-league-table-ranking-iii.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| Window Function |
3328 | [Find Cities in Each State II](https://leetcode.com/problems/find-cities-in-each-state-ii/) | [MySQL](./MySQL/find-cities-in-each-state-ii.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| |
3338 | [Second Highest Salary II](https://leetcode.com/problems/second-highest-salary-ii/) | [MySQL](./MySQL/second-highest-salary-ii.sql) | _O(nlogn)_ | _O(n)_ | Medium |š| Window Function |
3358 | [Books with NULL Ratings](https://leetcode.com/problems/books-with-null-ratings/) | [MySQL](./MySQL/books-with-null-ratings.sql) | _O(nlogn)_ | _O(n)_ | Easy |š| |
3368 | [First Letter Capitalization](https://leetcode.com/problems/first-letter-capitalization/) | [MySQL](./MySQL/first-letter-capitalization.sql) | _O(n * l^2 + (n * l) * log(n * l))_ | _O(n * l^2)_ | Hard |š| Recursive CTE |
3374 | [First Letter Capitalization II](https://leetcode.com/problems/first-letter-capitalization-ii/) | [MySQL](./MySQL/first-letter-capitalization-ii.sql) | _O(n * l^2 + (n * l) * log(n * l))_ | _O(n * l^2)_ | Hard |š| Recursive CTE |
3384 | [Team Dominance by Pass Success](https://leetcode.com/problems/team-dominance-by-pass-success/) | [MySQL](./MySQL/team-dominance-by-pass-success.sql) | _O(plogp + t)_ | _O(p + t)_ | Hard |š| |
3390 | [Longest Team Pass Streak](https://leetcode.com/problems/longest-team-pass-streak/) | [MySQL](./MySQL/longest-team-pass-streak.sql) | _O(plogp + t)_ | _O(p + t)_ | Hard |š| Recursive CTE, Window Function |
## PD
| # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----|
2877 | [Create a DataFrame from List](https://leetcode.com/problems/create-a-dataframe-from-list/) | [Python3](./Python3/create-a-dataframe-from-list.py3) | _O(n)_ | _O(1)_ | Easy |||
2878 | [Get the Size of a DataFrame](https://leetcode.com/problems/get-the-size-of-a-dataframe/) | [Python3](./Python3/get-the-size-of-a-dataframe.py3) | _O(1)_ | _O(1)_ | Easy |||
2879 | [Display the First Three Rows](https://leetcode.com/problems/display-the-first-three-rows/) | [Python3](./Python3/display-the-first-three-rows.py3) | _O(1)_ | _O(1)_ | Easy |||
2880 | [Select Data](https://leetcode.com/problems/select-data/) | [Python3](./Python3/select-data.py3) | _O(n)_ | _O(n)_ | Easy |||
2881 | [Create a New Column](https://leetcode.com/problems/create-a-new-column/) | [Python3](./Python3/create-a-new-column.py3) | _O(n)_ | _O(1)_ | Easy |||
2882 | [Drop Duplicate Rows](https://leetcode.com/problems/drop-duplicate-rows/) | [Python3](./Python3/drop-duplicate-rows.py3) | _O(n)_ | _O(n)_ | Easy |||
2883 | [Drop Missing Data](https://leetcode.com/problems/drop-missing-data/) | [Python3](./Python3/drop-missing-data.py3) | _O(n)_ | _O(1)_ | Easy |||
2884 | [Modify Columns](https://leetcode.com/problems/modify-columns/) | [Python3](./Python3/modify-columns.py3) | _O(n)_ | _O(1)_ | Easy |||
2885 | [Rename Columns](https://leetcode.com/problems/rename-columns/) | [Python3](./Python3/rename-columns.py3) | _O(n)_ | _O(1)_ | Easy |||
2886 | [Change Data Type](https://leetcode.com/problems/change-data-type/) | [Python3](./Python3/change-data-type.py3) | _O(n)_ | _O(1)_ | Easy |||
2887 | [Fill Missing Data](https://leetcode.com/problems/fill-missing-data/) | [Python3](./Python3/fill-missing-data.py3) | _O(n)_ | _O(1)_ | Easy |||
2888 | [Reshape Data: Concatenate](https://leetcode.com/problems/reshape-data-concatenate/) | [Python3](./Python3/reshape-data-concatenate.py3) | _O(n + m)_ | _O(1)_ | Easy |||
2889 | [Reshape Data: Pivot](https://leetcode.com/problems/reshape-data-pivot/) | [Python3](./Python3/reshape-data-pivot.py3) | _O(n)_ | _O(1)_ | Easy |||
2890 | [Reshape Data: Melt](https://leetcode.com/problems/reshape-data-melt/) | [Python3](./Python3/reshape-data-melt.py3) | _O(n)_ | _O(1)_ | Easy |||
2891 | [Method Chaining](https://leetcode.com/problems/method-chaining/) | [Python3](./Python3/method-chaining.py3) | _O(nlogn)_ | _O(n)_ | Easy |||
<br/>
<div align="right">
<b><a href="#algorithms">ā¬ļø Back to Top</a></b>
</div>
<br/>
", Assign "at most 3 tags" to the expected json: {"id":"6097","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"