Skip to content

Latest commit

 

History

History
719 lines (710 loc) · 151 KB

array-general.md

File metadata and controls

719 lines (710 loc) · 151 KB

Array / General LeetCode Problems

A collection of LeetCode problems solved using Array / General pattern techniques, explanations, and complexity analysis.

Problems

Easy

# Problem Language Time Space Explanation
26 Remove Duplicates from Sorted Array Python O(n) O(1) Explanation
27 Remove Element Python O(n) O(1) Explanation
70 Climbing Stairs JavaScript, Python O(n) O(1) Explanation
88 Merge Sorted Array PHP O(n) O(1) Explanation
136 Single Number JavaScript, PHP, Python O(n) O(1) Explanation
168 Excel Sheet Column Title PHP O(n) O(1) Explanation
169 Majority Element JavaScript, PHP O(n) O(1) Explanation
171 Excel Sheet Column Number PHP O(n) O(1) Explanation
193 Valid Phone Numbers Shell O(n) O(1) Explanation
195 Tenth Line Shell O(n) O(1) Explanation
205 Isomorphic Strings PHP O(n) O(1) Explanation
217 Contains Duplicate PHP O(n) O(1) Explanation
219 Contains Duplicate II PHP, Python O(n) O(1) Explanation
231 Power of Two PHP O(n) O(1) Explanation
263 Ugly Number PHP, Python O(n) O(1) Explanation
268 Missing Number PHP O(n) O(1) Explanation
283 Move Zeroes C++, JavaScript O(n) O(1) Explanation
292 Nim Game C++, Kotlin O(n) O(1) Explanation
326 Power of Three C++ O(n) O(1) Explanation
383 Ransom Note Python O(n) O(1) Explanation
389 Find the Difference Python O(n) O(1) Explanation
412 Fizz Buzz Python O(n) O(1) Explanation
414 Third Maximum Number Python O(n) O(1) Explanation
415 Add Strings Python O(n) O(1) Explanation
434 Number of Segments in a String Python O(n) O(1) Explanation
455 Assign Cookies Python O(n) O(1) Explanation
459 Repeated Substring Pattern JavaScript, Python O(n) O(1) Explanation
506 Relative Ranks Python O(n) O(1) Explanation
507 Perfect Number Python O(n) O(1) Explanation
509 Fibonacci Number Python O(n) O(1) Explanation
511 Game Play Analysis I Python O(n) O(1) Explanation
520 Detect Capital JavaScript, Python O(n) O(1) Explanation
557 Reverse Words in a String III Python O(n) O(1) Explanation
561 Array Partition Python O(n) O(1) Explanation
575 Distribute Candies Python O(n) O(1) Explanation
657 Robot Return to Origin Python O(n) O(1) Explanation
661 Image Smoother Python O(n) O(1) Explanation
703 Kth Largest Element in a Stream Python O(n) O(1) Explanation
709 To Lower Case Python O(n) O(1) Explanation
728 Self Dividing Numbers Python O(n) O(1) Explanation
747 Largest Number At Least Twice of Others Python O(n) O(1) Explanation
771 Jewels and Stones Python O(n) O(1) Explanation
806 Number of Lines To Write String Python O(n) O(1) Explanation
821 Shortest Distance to a Character Python O(n) O(1) Explanation
824 Goat Latin Python O(n) O(1) Explanation
832 Flipping an Image Python O(n) O(1) Explanation
860 Lemonade Change Python O(n) O(1) Explanation
883 Projection Area of 3D Shapes Python O(n) O(1) Explanation
888 Fair Candy Swap Python O(n) O(1) Explanation
892 Surface Area of 3D Shapes Python O(n) O(1) Explanation
922 Sort Array By Parity II Python O(n) O(1) Explanation
925 Long Pressed Name Python O(n) O(1) Explanation
942 DI String Match Python O(n) O(1) Explanation
944 Delete Columns to Make Sorted Python O(n) O(1) Explanation
961 N-Repeated Element in Size 2N Array Python O(n) O(1) Explanation
977 Squares of a Sorted Array Python O(n) O(1) Explanation
989 Add to Array-Form of Integer Python O(n) O(1) Explanation
997 Find the Town Judge Python O(n) O(1) Explanation
999 Available Captures for Rook Python O(n) O(1) Explanation
1005 Maximize Sum Of Array After K Negations Python O(n) O(1) Explanation
1013 Partition Array Into Three Parts With Equal Sum Python O(n) O(1) Explanation
1025 Divisor Game Python O(n) O(1) Explanation
1037 Valid Boomerang Python O(n) O(1) Explanation
1078 Occurrences After Bigram Python O(n) O(1) Explanation
1089 Duplicate Zeros Python O(n) O(1) Explanation
1103 Distribute Candies to People Python O(n) O(1) Explanation
1108 Defanging an IP Address Python O(n) O(1) Explanation
1154 Day of the Year Python O(n) O(1) Explanation
1185 Day of the Week Python O(n) O(1) Explanation
1200 Minimum Absolute Difference Python O(n) O(1) Explanation
1221 Split a String in Balanced Strings Python O(n) O(1) Explanation
1232 Check If It Is a Straight Line Python O(n) O(1) Explanation
1275 Find Winner on a Tic Tac Toe Game Python O(n) O(1) Explanation
1287 Element Appearing More Than 25% In Sorted Array Python O(n) O(1) Explanation
1313 Decompress Run-Length Encoded List Python O(n) O(1) Explanation
1323 Maximum 69 Number Python O(n) O(1) Explanation
1342 Number of Steps to Reduce a Number to Zero Python O(n) O(1) Explanation
1346 Check If N and Its Double Exist Python O(n) O(1) Explanation
1360 Number of Days Between Two Dates Python O(n) O(1) Explanation
1374 Generate a String With Characters That Have Odd Counts Python O(n) O(1) Explanation
1385 Find the Distance Value Between Two Arrays Python O(n) O(1) Explanation
1408 String Matching in an Array Python O(n) O(1) Explanation
1413 Minimum Value to Get Positive Step by Step Sum Python O(n) O(1) Explanation
1422 Maximum Score After Splitting a String Python O(n) O(1) Explanation
1436 Destination City Python O(n) O(1) Explanation
1437 Check If All 1's Are at Least Length K Places Away Python O(n) O(1) Explanation
1446 Consecutive Characters Python O(n) O(1) Explanation
1470 Shuffle the Array TypeScript O(n) O(1) Explanation
1480 Running Sum of 1d Array Python O(n) O(1) Explanation
1491 Average Salary Excluding the Minimum and Maximum Salary Python O(n) O(1) Explanation
1502 Can Make Arithmetic Progression From Sequence Python O(n) O(1) Explanation
1507 Reformat Date Python O(n) O(1) Explanation
1518 Water Bottles Python O(n) O(1) Explanation
1528 Shuffle String Python O(n) O(1) Explanation
1550 Three Consecutive Odds Python O(n) O(1) Explanation
1556 Thousand Separator Python O(n) O(1) Explanation
1588 Sum of All Odd Length Subarrays C++ O(n) O(1) Explanation
1592 Rearrange Spaces Between Words C++ O(n) O(1) Explanation
1598 Crawler Log Folder C++ O(n) O(1) Explanation
1603 Design Parking System C++ O(n) O(1) Explanation
1608 Special Array With X Elements Greater Than or Equal X C++ O(n) O(1) Explanation
1624 Largest Substring Between Two Equal Characters C++ O(n) O(1) Explanation
1646 Get Maximum in Generated Array C++ O(n) O(1) Explanation
1652 Defuse the Bomb C++ O(n) O(1) Explanation
1662 Check If Two String Arrays are Equivalent C++ O(n) O(1) Explanation
1668 Maximum Repeating Substring C++ O(n) O(1) Explanation
1672 Richest Customer Wealth C++ O(n) O(1) Explanation
1678 Goal Parser Interpretation C++ O(n) O(1) Explanation
1694 Reformat Phone Number C++ O(n) O(1) Explanation
1704 Determine if String Halves Are Alike C++ O(n) O(1) Explanation
1716 Calculate Money in Leetcode Bank C++ O(n) O(1) Explanation
1768 Merge Strings Alternately C++ O(n) O(1) Explanation
1773 Count Items Matching a Rule C++ O(n) O(1) Explanation
1790 Check if One String Swap Can Make Strings Equal C++ O(n) O(1) Explanation
1791 Find Center of Star Graph C++ O(n) O(1) Explanation
1812 Determine Color of a Chessboard Square C++ O(n) O(1) Explanation
1816 Truncate Sentence C++ O(n) O(1) Explanation
1822 Sign of the Product of an Array C++ O(n) O(1) Explanation
1832 Check if the Sentence Is Pangram C++ O(n) O(1) Explanation
1859 Sorting the Sentence C++ O(n) O(1) Explanation
1869 Longer Contiguous Segments of Ones than Zeros C++ O(n) O(1) Explanation
1876 Substrings of Size Three with Distinct Characters C++ O(n) O(1) Explanation
1880 Check if Word Equals Summation of Two Words C++ O(n) O(1) Explanation
1897 Redistribute Characters to Make All Strings Equal C++ O(n) O(1) Explanation
1925 Count Square Sum Triples C++ O(n) O(1) Explanation
1929 Concatenation of Array TypeScript O(n) O(1) Explanation
1935 Maximum Number of Words You Can Type C++ O(n) O(1) Explanation
1952 Three Divisors C++ O(n) O(1) Explanation
1957 Delete Characters to Make Fancy String C++ O(n) O(1) Explanation
1979 Find Greatest Common Divisor of Array Kotlin O(n) O(1) Explanation
1995 Count Special Quadruplets JavaScript O(n) O(1) Explanation
2032 Two Out of Three Python O(n) O(1) Explanation
2047 Number of Valid Words in a Sentence JavaScript O(n) O(1) Explanation
2062 Count Vowel Substrings of a String JavaScript O(n) O(1) Explanation
2089 Find Target Indices After Sorting Array Python O(n) O(1) Explanation
2103 Rings and Rods JavaScript O(n) O(1) Explanation
2114 Maximum Number of Words Found in Sentences Python O(n) O(1) Explanation
2124 Check if All A's Appears Before All B's Python O(n) O(1) Explanation
2133 Check if Every Row and Column Contains All Numbers Python O(n) O(1) Explanation
2138 Divide a String Into Groups of Size k Python O(n) O(1) Explanation
2164 Sort Even and Odd Indices Independently JavaScript O(n) O(1) Explanation
2215 Find the Difference of Two Arrays JavaScript O(n) O(1) Explanation
2224 Minimum Number of Operations to Convert Time Python O(n) O(1) Explanation
2309 Greatest English Letter in Upper and Lower Case Python O(n) O(1) Explanation
2335 Minimum Amount of Time to Fill Cups Python O(n) O(1) Explanation
2351 First Letter to Appear Twice Java O(n) O(1) Explanation
2357 Make Array Zero by Subtracting Equal Amounts JavaScript O(n) O(1) Explanation
2363 Merge Similar Items JavaScript O(n) O(1) Explanation
2367 Number of Arithmetic Triplets Python O(n) O(1) Explanation
2383 Minimum Hours of Training to Win a Competition Python O(n) O(1) Explanation
2418 Sort the People JavaScript O(n) O(1) Explanation
2437 Number of Valid Clock Times Python O(n) O(1) Explanation
2441 Largest Positive Integer That Exists With Its Negative JavaScript O(n) O(1) Explanation
2465 Number of Distinct Averages JavaScript O(n) O(1) Explanation
2475 Number of Unequal Triplets in Array JavaScript O(n) O(1) Explanation
2485 Find the Pivot Integer Python O(n) O(1) Explanation
2578 Split With Minimum Sum Python O(n) O(1) Explanation
2586 Count the Number of Vowel Strings in Range Python O(n) O(1) Explanation
2591 Distribute Money to Maximum Children Python O(n) O(1) Explanation
2600 K Items With the Maximum Sum Python O(n) O(1) Explanation
2619 Array Prototype Last JavaScript O(n) O(1) Explanation
2620 Counter JavaScript O(n) O(1) Explanation
2621 Sleep JavaScript O(n) O(1) Explanation
2626 Array Reduce Transformation TypeScript O(n) O(1) Explanation
2629 Function Composition TypeScript O(n) O(1) Explanation
2634 Filter Elements from Array TypeScript O(n) O(1) Explanation
2643 Row With Maximum Ones Python O(n) O(1) Explanation
2648 Generate Fibonacci Sequence TypeScript O(n) O(1) Explanation
2656 Maximum Sum With Exactly K Elements Python O(n) O(1) Explanation
2660 Determine the Winner of a Bowling Game JavaScript O(n) O(1) Explanation
2665 Counter II TypeScript O(n) O(1) Explanation
2666 Allow One Function Call TypeScript O(n) O(1) Explanation
2677 Chunk Array TypeScript O(n) O(1) Explanation
2682 Find the Losers of the Circular Game JavaScript O(n) O(1) Explanation
2695 Array Wrapper TypeScript O(n) O(1) Explanation
2704 To Be Or Not To Be TypeScript O(n) O(1) Explanation
2706 Buy Two Chocolates Python O(n) O(1) Explanation
2724 Sort By TypeScript O(n) O(1) Explanation
2727 Is Object Empty TypeScript O(n) O(1) Explanation
2744 Find Maximum Number of String Pairs JavaScript O(n) O(1) Explanation
2765 Longest Alternating Subarray Python O(n) O(1) Explanation
2778 Sum of Squares of Special Elements JavaScript O(n) O(1) Explanation
2784 Check if Array is Good C++ O(n) O(1) Explanation
2810 Faulty Keyboard JavaScript O(n) O(1) Explanation
2824 Count Pairs Whose Sum is Less than Target Python O(n) O(1) Explanation
2833 Furthest Point From Origin Python O(n) O(1) Explanation
2843 Count Symmetric Integers Python O(n) O(1) Explanation
2869 Minimum Operations to Collect Elements Python O(n) O(1) Explanation
2879 Display the First Three Rows Python O(n) O(1) Explanation
2882 Drop Duplicate Rows Python O(n) O(1) Explanation
2899 Last Visited Integers JavaScript O(n) O(1) Explanation
2923 Find Champion I Python O(n) O(1) Explanation
2960 Count Tested Devices After Test Operations JavaScript O(n) O(1) Explanation
2965 Find Missing and Repeated Values Python O(n) O(1) Explanation
2970 Count the Number of Incremovable Subarrays I Python O(n) O(1) Explanation
3010 Divide an Array Into Subarrays With Minimum Cost I Python O(n) O(1) Explanation
3028 Ant on the Boundary JavaScript O(n) O(1) Explanation
3046 Split the Array Python O(n) O(1) Explanation
3074 Apple Redistribution into Boxes JavaScript O(n) O(1) Explanation
3114 Latest Time You Can Obtain After Replacing Characters Python O(n) O(1) Explanation
3178 Find the Child Who Has the Ball After K Seconds JavaScript O(n) O(1) Explanation
3216 Lexicographically Smallest String After a Swap JavaScript O(n) O(1) Explanation
3222 Find the Winning Player in Coin Game Python O(n) O(1) Explanation
3238 Find the Number of Winning Players Python O(n) O(1) Explanation
3242 Design Neighbor Sum Service JavaScript O(n) O(1) Explanation
3258 Count Substrings That Satisfy K-Constraint I Python O(n) O(1) Explanation
3304 Find the K-th Character in String Game I Python O(n) O(1) Explanation
3360 Stone Removal Game JavaScript O(n) O(1) Explanation
3364 Minimum Positive Sum Subarray Python O(n) O(1) Explanation
3379 Transformed Array JavaScript O(n) O(1) Explanation
3407 Substring Matching Pattern Python O(n) O(1) Explanation
3432 Count Partitions with Even Sum Difference JavaScript O(n) O(1) Explanation
3467 Transform Array by Parity JavaScript O(n) O(1) Explanation
3487 Maximum Unique Subarray Sum After Deletion JavaScript O(n) O(1) Explanation
3498 Reverse Degree of a String Python O(n) O(1) Explanation
3507 Minimum Pair Removal to Sort Array I Python O(n) O(1) Explanation
3570 Find Books with No Available Copies Python O(n) O(1) Explanation
3582 Generate Tag for Video Caption Python O(n) O(1) Explanation
3633 Earliest Finish Time for Land and Water Rides I Kotlin O(n) O(1) Explanation
3684 Maximize Sum of At Most K Distinct Elements JavaScript O(n) O(1) Explanation
3707 Equal Score Substrings Python O(n) O(1) Explanation
3736 Minimum Moves to Equal Array Elements III Python O(n) O(1) Explanation
3813 Vowel-Consonant Score Python O(n) O(1) Explanation
3823 Reverse Letters Then Special Characters in a String Python O(n) O(1) Explanation
3842 Toggle Light Bulbs Python O(n) O(1) Explanation
3880 Minimum Absolute Difference Between Two Values Python O(n) O(1) Explanation
3894 Traffic Signal Color Python O(n) O(1) Explanation
4020 Elevator Requests I Python O(n) O(1) Explanation
4024 Nearest Available Drone Python O(n) O(1) Explanation
4043 Count Rotations With Exactly K Equal Adjacent Pairs Python O(n) O(1) Explanation
4052 Cyclically Shift Rows and Columns Python O(n) O(1) Explanation

Medium

# Problem Language Time Space Explanation
5 Longest Palindromic Substring JavaScript, Python O(n) O(1) Explanation
36 Valid Sudoku Python O(n) O(1) Explanation
122 Best Time to Buy and Sell Stock II JavaScript O(n) O(1) Explanation
151 Reverse Words in a String JavaScript O(n) O(1) Explanation
179 Largest Number Python O(n) O(1) Explanation
194 Transpose File Shell O(n) O(1) Explanation
210 Course Schedule II JavaScript O(n) O(1) Explanation
264 Ugly Number II Python O(n) O(1) Explanation
274 H-Index JavaScript O(n) O(1) Explanation
299 Bulls and Cows Python O(n) O(1) Explanation
304 Range Sum Query 2D - Immutable JavaScript O(n) O(1) Explanation
368 Largest Divisible Subset JavaScript O(n) O(1) Explanation
371 Sum of Two Integers Python O(n) O(1) Explanation
372 Super Pow Python O(n) O(1) Explanation
384 Shuffle an Array Python O(n) O(1) Explanation
390 Elimination Game Python O(n) O(1) Explanation
397 Integer Replacement Python O(n) O(1) Explanation
413 Arithmetic Slices Python O(n) O(1) Explanation
443 String Compression JavaScript O(n) O(1) Explanation
467 Unique Substrings in Wraparound String Python O(n) O(1) Explanation
523 Continuous Subarray Sum Python O(n) O(1) Explanation
525 Contiguous Array Python O(n) O(1) Explanation
537 Complex Number Multiplication Python O(n) O(1) Explanation
570 Managers with at Least 5 Direct Reports Python O(n) O(1) Explanation
624 Maximum Distance in Arrays Python O(n) O(1) Explanation
633 Sum of Square Numbers Python O(n) O(1) Explanation
640 Solve the Equation Python O(n) O(1) Explanation
641 Design Circular Deque JavaScript O(n) O(1) Explanation
646 Maximum Length of Pair Chain Python O(n) O(1) Explanation
647 Palindromic Substrings Python O(n) O(1) Explanation
649 Dota2 Senate JavaScript O(n) O(1) Explanation
672 Bulb Switcher II Python O(n) O(1) Explanation
752 Open the Lock Python O(n) O(1) Explanation
754 Reach a Number Python O(n) O(1) Explanation
763 Partition Labels Python O(n) O(1) Explanation
769 Max Chunks To Make Sorted Python O(n) O(1) Explanation
779 K-th Symbol in Grammar Python O(n) O(1) Explanation
786 K-th Smallest Prime Fraction Python O(n) O(1) Explanation
802 Find Eventual Safe States JavaScript O(n) O(1) Explanation
809 Expressive Words Python O(n) O(1) Explanation
816 Ambiguous Coordinates Python O(n) O(1) Explanation
820 Short Encoding of Words Python O(n) O(1) Explanation
822 Card Flipping Game Python O(n) O(1) Explanation
825 Friends Of Appropriate Ages Python O(n) O(1) Explanation
831 Masking Personal Information JavaScript O(n) O(1) Explanation
838 Push Dominoes Python O(n) O(1) Explanation
848 Shifting Letters Python O(n) O(1) Explanation
851 Loud and Rich JavaScript O(n) O(1) Explanation
853 Car Fleet Python O(n) O(1) Explanation
870 Advantage Shuffle Python O(n) O(1) Explanation
874 Walking Robot Simulation Python O(n) O(1) Explanation
880 Decoded String at Index JavaScript O(n) O(1) Explanation
881 Boats to Save People Python O(n) O(1) Explanation
910 Smallest Range II Python O(n) O(1) Explanation
932 Beautiful Array Python O(n) O(1) Explanation
937 Reorder Data in Log Files Python O(n) O(1) Explanation
948 Bag of Tokens JavaScript O(n) O(1) Explanation
955 Delete Columns to Make Sorted II Python O(n) O(1) Explanation
969 Pancake Sorting Python O(n) O(1) Explanation
970 Powerful Integers Python O(n) O(1) Explanation
974 Subarray Sums Divisible by K Python O(n) O(1) Explanation
978 Longest Turbulent Subarray Python O(n) O(1) Explanation
984 String Without AAA or BBB Python O(n) O(1) Explanation
990 Satisfiability of Equality Equations Python O(n) O(1) Explanation
1007 Minimum Domino Rotations For Equal Row Python O(n) O(1) Explanation
1010 Pairs of Songs With Total Durations Divisible by 60 Python O(n) O(1) Explanation
1011 Capacity To Ship Packages Within D Days Python O(n) O(1) Explanation
1023 Camelcase Matching Python O(n) O(1) Explanation
1024 Video Stitching Python O(n) O(1) Explanation
1029 Two City Scheduling Python O(n) O(1) Explanation
1031 Maximum Sum of Two Non-Overlapping Subarrays Python O(n) O(1) Explanation
1052 Grumpy Bookstore Owner Python O(n) O(1) Explanation
1094 Car Pooling Python O(n) O(1) Explanation
1109 Corporate Flight Bookings Python O(n) O(1) Explanation
1117 Building H2O C++ O(n) O(1) Explanation
1144 Decrease Elements To Make Array Zigzag Python O(n) O(1) Explanation
1191 K-Concatenation Maximum Sum Python O(n) O(1) Explanation
1195 Fizz Buzz Multithreaded C++ O(n) O(1) Explanation
1208 Get Equal Substrings Within Budget Python O(n) O(1) Explanation
1226 The Dining Philosophers C++ O(n) O(1) Explanation
1227 Airplane Seat Assignment Probability Python O(n) O(1) Explanation
1233 Remove Sub-Folders from the Filesystem Python O(n) O(1) Explanation
1247 Minimum Swaps to Make Strings Equal Python O(n) O(1) Explanation
1248 Count Number of Nice Subarrays Python O(n) O(1) Explanation
1262 Greatest Sum Divisible by Three Python O(n) O(1) Explanation
1267 Count Servers that Communicate Python O(n) O(1) Explanation
1283 Find the Smallest Divisor Given a Threshold Python O(n) O(1) Explanation
1292 Maximum Side Length of a Square with Sum Less than or Equal to Threshold JavaScript O(n) O(1) Explanation
1300 Sum of Mutated Array Closest to Target Python O(n) O(1) Explanation
1319 Number of Operations to Make Network Connected Python O(n) O(1) Explanation
1333 Filter Restaurants by Vegan-Friendly, Price and Distance JavaScript O(n) O(1) Explanation
1334 Find the City With the Smallest Number of Neighbors at a Threshold Distance Python O(n) O(1) Explanation
1353 Maximum Number of Events That Can Be Attended Python O(n) O(1) Explanation
1366 Rank Teams by Votes Python O(n) O(1) Explanation
1390 Four Divisors Python O(n) O(1) Explanation
1410 HTML Entity Parser Python O(n) O(1) Explanation
1414 Find the Minimum Number of Fibonacci Numbers Whose Sum Is K Python O(n) O(1) Explanation
1424 Diagonal Traverse II JavaScript O(n) O(1) Explanation
1432 Max Difference You Can Get From Changing an Integer Python O(n) O(1) Explanation
1433 Check If a String Can Break Another String Python O(n) O(1) Explanation
1451 Rearrange Words in a Sentence Python O(n) O(1) Explanation
1462 Course Schedule IV JavaScript O(n) O(1) Explanation
1465 Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts Python O(n) O(1) Explanation
1482 Minimum Number of Days to Make m Bouquets Python O(n) O(1) Explanation
1492 The kth Factor of n Kotlin, Python O(n) O(1) Explanation
1497 Check If Array Pairs Are Divisible by k Python O(n) O(1) Explanation
1503 Last Moment Before All Ants Fall Out of a Plank Python O(n) O(1) Explanation
1508 Range Sum of Sorted Subarray Sums Python O(n) O(1) Explanation
1509 Minimum Difference Between Largest and Smallest Value in Three Moves Python O(n) O(1) Explanation
1513 Number of Substrings With Only 1s Python O(n) O(1) Explanation
1535 Find the Winner of an Array Game Python O(n) O(1) Explanation
1540 Can Convert String in K Moves Python O(n) O(1) Explanation
1546 Maximum Number of Non-Overlapping Subarrays With Sum Equals Target JavaScript O(n) O(1) Explanation
1552 Magnetic Force Between Two Balls Python O(n) O(1) Explanation
1561 Maximum Number of Coins You Can Get Python O(n) O(1) Explanation
1567 Maximum Length of Subarray With Positive Product Python O(n) O(1) Explanation
1584 Min Cost to Connect All Points Python O(n) O(1) Explanation
1626 Best Team With No Conflicts JavaScript O(n) O(1) Explanation
1630 Arithmetic Subarrays Python O(n) O(1) Explanation
1642 Furthest Building You Can Reach Python O(n) O(1) Explanation
1653 Minimum Deletions to Make String Balanced C++ O(n) O(1) Explanation
1686 Stone Game VI Python O(n) O(1) Explanation
1695 Maximum Erasure Value Python O(n) O(1) Explanation
1750 Minimum Length of String After Deleting Similar Ends Python O(n) O(1) Explanation
1753 Maximum Score From Removing Stones Python O(n) O(1) Explanation
1759 Count Number of Homogenous Substrings Python O(n) O(1) Explanation
1764 Form Array by Concatenating Subarrays of Another Array Python O(n) O(1) Explanation
1769 Minimum Number of Operations to Move All Balls to Each Box Python O(n) O(1) Explanation
1785 Minimum Elements to Add to Form a Given Sum Python O(n) O(1) Explanation
1792 Maximum Average Pass Ratio Python O(n) O(1) Explanation
1798 Maximum Number of Consecutive Values You Can Make Python O(n) O(1) Explanation
1801 Number of Orders in the Backlog Python O(n) O(1) Explanation
1823 Find the Winner of the Circular Game JavaScript O(n) O(1) Explanation
1824 Minimum Sideway Jumps Python O(n) O(1) Explanation
1834 Single-Threaded CPU JavaScript O(n) O(1) Explanation
1839 Longest Substring Of All Vowels in Order Python O(n) O(1) Explanation
1861 Rotating the Box C++ O(n) O(1) Explanation
1877 Minimize Maximum Pair Sum in Array Python O(n) O(1) Explanation
1887 Reduction Operations to Make the Array Elements Equal Python O(n) O(1) Explanation
1895 Largest Magic Square Python O(n) O(1) Explanation
1898 Maximum Number of Removable Characters Python O(n) O(1) Explanation
1899 Merge Triplets to Form Target Triplet Python O(n) O(1) Explanation
1910 Remove All Occurrences of a Substring C++ O(n) O(1) Explanation
1921 Eliminate Maximum Number of Monsters JavaScript O(n) O(1) Explanation
1927 Sum Game C++ O(n) O(1) Explanation
1936 Add Minimum Number of Rungs Python O(n) O(1) Explanation
1953 Maximum Number of Weeks for Which You Can Work Python O(n) O(1) Explanation
1962 Remove Stones to Minimize the Total Python O(n) O(1) Explanation
1963 Minimum Number of Swaps to Make the String Balanced Python O(n) O(1) Explanation
1968 Array With Elements Not Equal to Average of Neighbors Python O(n) O(1) Explanation
1981 Minimize the Difference Between Target and Chosen Elements Python O(n) O(1) Explanation
1985 Find the Kth Largest Integer in the Array JavaScript O(n) O(1) Explanation
1996 The Number of Weak Characters in the Game Python O(n) O(1) Explanation
2007 Find Original Array From Doubled Array Python O(n) O(1) Explanation
2018 Check if Word Can Be Placed In Crossword Python O(n) O(1) Explanation
2024 Maximize the Confusion of an Exam Python O(n) O(1) Explanation
2028 Find Missing Observations Python O(n) O(1) Explanation
2038 Remove Colored Pieces if Both Neighbors are the Same Color Python O(n) O(1) Explanation
2043 Simple Bank System Python O(n) O(1) Explanation
2054 Two Best Non-Overlapping Events Python O(n) O(1) Explanation
2069 Walking Robot Simulation II JavaScript O(n) O(1) Explanation
2070 Most Beautiful Item for Each Query Python O(n) O(1) Explanation
2079 Watering Plants Python O(n) O(1) Explanation
2086 Minimum Number of Food Buckets to Feed the Hamsters Python O(n) O(1) Explanation
2091 Removing Minimum and Maximum From Array C++ O(n) O(1) Explanation
2105 Watering Plants II Python O(n) O(1) Explanation
2109 Adding Spaces to a String JavaScript O(n) O(1) Explanation
2110 Number of Smooth Descent Periods of a Stock Python O(n) O(1) Explanation
2125 Number of Laser Beams in a Bank Python O(n) O(1) Explanation
2139 Minimum Moves to Reach Target Score Python O(n) O(1) Explanation
2149 Rearrange Array Elements by Sign Python O(n) O(1) Explanation
2165 Smallest Value of the Rearranged Number JavaScript O(n) O(1) Explanation
2177 Find Three Consecutive Integers That Sum to a Given Number Python O(n) O(1) Explanation
2187 Minimum Time to Complete Trips Python O(n) O(1) Explanation
2191 Sort the Jumbled Numbers JavaScript O(n) O(1) Explanation
2195 Append K Integers With Minimal Sum Python O(n) O(1) Explanation
2202 Maximize the Topmost Element After K Moves Python O(n) O(1) Explanation
2208 Minimum Operations to Halve Array Sum Python O(n) O(1) Explanation
2211 Count Collisions on a Road Python O(n) O(1) Explanation
2221 Find Triangular Sum of an Array JavaScript O(n) O(1) Explanation
2226 Maximum Candies Allocated to K Children Python O(n) O(1) Explanation
2233 Maximum Product After K Increments Python O(n) O(1) Explanation
2240 Number of Ways to Buy Pens and Pencils Python O(n) O(1) Explanation
2274 Maximum Consecutive Floors Without Special Floors JavaScript O(n) O(1) Explanation
2279 Maximum Bags With Full Capacity of Rocks Python O(n) O(1) Explanation
2294 Partition Array Such That Maximum Difference Is K Python O(n) O(1) Explanation
2332 The Latest Time to Catch a Bus Python O(n) O(1) Explanation
2343 Query Kth Smallest Trimmed Number JavaScript O(n) O(1) Explanation
2358 Maximum Number of Groups Entering a Competition Python O(n) O(1) Explanation
2384 Largest Palindromic Number Python O(n) O(1) Explanation
2396 Strictly Palindromic Number Python O(n) O(1) Explanation
2405 Optimal Partition of String Python O(n) O(1) Explanation
2410 Maximum Matching of Players With Trainers Python O(n) O(1) Explanation
2439 Minimize Maximum of Array Python O(n) O(1) Explanation
2442 Count Number of Distinct Integers After Reverse Operations Python O(n) O(1) Explanation
2443 Sum of Number and Its Reverse Python O(n) O(1) Explanation
2456 Most Popular Video Creator JavaScript O(n) O(1) Explanation
2457 Minimum Addition to Make Integer Beautiful Python O(n) O(1) Explanation
2482 Difference Between Ones and Zeros in Row and Column JavaScript O(n) O(1) Explanation
2491 Divide Players Into Teams of Equal Skill JavaScript O(n) O(1) Explanation
2498 Frog Jump II Python O(n) O(1) Explanation
2507 Smallest Value After Replacing With Sum of Prime Factors JavaScript O(n) O(1) Explanation
2521 Distinct Prime Factors of Product of Array JavaScript O(n) O(1) Explanation
2522 Partition String Into Substrings With Values at Most K Python O(n) O(1) Explanation
2530 Maximal Score After Applying K Operations Python O(n) O(1) Explanation
2541 Minimum Operations to Make Array Equal II Python O(n) O(1) Explanation
2550 Count Collisions of Monkeys on a Polygon Python O(n) O(1) Explanation
2559 Count Vowel Strings in Ranges JavaScript O(n) O(1) Explanation
2563 Count the Number of Fair Pairs Python O(n) O(1) Explanation
2576 Find the Maximum Number of Marked Indices Python O(n) O(1) Explanation
2592 Maximize Greatness of an Array Python O(n) O(1) Explanation
2598 Smallest Missing Non-negative Integer After Operations Python O(n) O(1) Explanation
2602 Minimum Operations to Make All Array Elements Equal Python O(n) O(1) Explanation
2611 Mice and Cheese Python O(n) O(1) Explanation
2616 Minimize the Maximum Difference of Pairs Python O(n) O(1) Explanation
2618 Check if Object Instance of Class JavaScript O(n) O(1) Explanation
2623 Memoize TypeScript O(n) O(1) Explanation
2631 Group By TypeScript O(n) O(1) Explanation
2645 Minimum Additions to Make Valid String Python O(n) O(1) Explanation
2649 Nested Array Generator TypeScript O(n) O(1) Explanation
2661 First Completely Painted Row or Column Python O(n) O(1) Explanation
2693 Call Function with Custom Context TypeScript O(n) O(1) Explanation
2705 Compact Object TypeScript O(n) O(1) Explanation
2712 Minimum Cost to Make All Characters Equal Python O(n) O(1) Explanation
2730 Find the Longest Semi-Repetitive Substring Python O(n) O(1) Explanation
2731 Movement of Robots Python O(n) O(1) Explanation
2734 Lexicographically Smallest String After Substring Operation Python O(n) O(1) Explanation
2735 Collecting Chocolates Python O(n) O(1) Explanation
2766 Relocate Marbles JavaScript O(n) O(1) Explanation
2772 Apply Operations to Make All Array Elements Equal to Zero JavaScript O(n) O(1) Explanation
2789 Largest Element in an Array after Merge Operations JavaScript O(n) O(1) Explanation
2800 Shortest String That Contains Three Strings Python O(n) O(1) Explanation
2811 Check if it is Possible to Split Array JavaScript O(n) O(1) Explanation
2826 Sorting Three Groups Python O(n) O(1) Explanation
2829 Determine the Minimum Sum of a k-avoiding Array JavaScript O(n) O(1) Explanation
2844 Minimum Operations to Make a Special Number Python O(n) O(1) Explanation
2860 Happy Students Python O(n) O(1) Explanation
2861 Maximum Number of Alloys Python O(n) O(1) Explanation
2865 Beautiful Towers I Python O(n) O(1) Explanation
2875 Minimum Size Subarray in Infinite Array Python O(n) O(1) Explanation
2895 Minimum Processing Time JavaScript O(n) O(1) Explanation
2910 Minimum Number of Groups to Create a Valid Assignment JavaScript O(n) O(1) Explanation
2918 Minimum Equal Sum of Two Arrays After Replacing Zeros JavaScript O(n) O(1) Explanation
2924 Find Champion II JavaScript O(n) O(1) Explanation
2929 Distribute Candies Among Children II JavaScript O(n) O(1) Explanation
2934 Minimum Operations to Maximize Last Elements in Arrays Python O(n) O(1) Explanation
2938 Separate Black and White Balls JavaScript O(n) O(1) Explanation
2947 Count Beautiful Substrings I JavaScript O(n) O(1) Explanation
2952 Minimum Number of Coins to be Added JavaScript O(n) O(1) Explanation
2957 Remove Adjacent Almost-Equal Characters JavaScript O(n) O(1) Explanation
2962 Count Subarrays Where Max Element Appears at Least K Times Python O(n) O(1) Explanation
2966 Divide Array Into Arrays With Max Difference JavaScript O(n) O(1) Explanation
2967 Minimum Cost to Make Array Equalindromic Python O(n) O(1) Explanation
2975 Maximum Square Area by Removing Fences From a Field Python O(n) O(1) Explanation
2976 Minimum Cost to Convert String I JavaScript O(n) O(1) Explanation
2982 Find Longest Special Substring That Occurs Thrice II Python O(n) O(1) Explanation
2998 Minimum Number of Operations to Make X and Y Equal Python O(n) O(1) Explanation
3001 Minimum Moves to Capture The Queen Python O(n) O(1) Explanation
3002 Maximum Size of a Set After Removals JavaScript O(n) O(1) Explanation
3025 Find the Number of Ways to Place People I Python O(n) O(1) Explanation
3029 Minimum Time to Revert Word to Initial State I Python O(n) O(1) Explanation
3034 Number of Subarrays That Match a Pattern I Python O(n) O(1) Explanation
3070 Count Submatrices with Top-Left Element and Sum Less Than k Python O(n) O(1) Explanation
3075 Maximize Happiness of Selected Children JavaScript O(n) O(1) Explanation
3076 Shortest Uncommon Substring in an Array Python O(n) O(1) Explanation
3080 Mark Elements on Array by Performing Queries JavaScript O(n) O(1) Explanation
3084 Count Substrings Starting and Ending with Given Character Python O(n) O(1) Explanation
3096 Minimum Levels to Gain More Points JavaScript O(n) O(1) Explanation
3100 Water Bottles II JavaScript O(n) O(1) Explanation
3106 Lexicographically Smallest String After Operations With Constraint JavaScript O(n) O(1) Explanation
3107 Minimum Operations to Make Median of Array Equal to K JavaScript O(n) O(1) Explanation
3132 Find the Integer Added to Array II Python O(n) O(1) Explanation
3152 Special Array II Python O(n) O(1) Explanation
3170 Lexicographically Minimum String After Removing Stars Python O(n) O(1) Explanation
3179 Find the N-th Value After K Seconds JavaScript O(n) O(1) Explanation
3195 Find the Minimum Area to Cover All Ones I Python O(n) O(1) Explanation
3207 Maximum Points After Enemy Battles JavaScript O(n) O(1) Explanation
3218 Minimum Cost for Cutting Cake I JavaScript O(n) O(1) Explanation
3227 Vowels Game in a String Python O(n) O(1) Explanation
3228 Maximum Number of Operations to Move Ones to the End Python O(n) O(1) Explanation
3254 Find the Power of K-Size Subarrays I Python O(n) O(1) Explanation
3255 Find the Power of K-Size Subarrays II Python O(n) O(1) Explanation
3265 Count Almost Equal Pairs I Python O(n) O(1) Explanation
3271 Hash Divided String JavaScript O(n) O(1) Explanation
3282 Reach End of Array With Max Score JavaScript O(n) O(1) Explanation
3301 Maximize the Total Height of Unique Towers JavaScript O(n) O(1) Explanation
3305 Count of Substrings Containing Every Vowel and K Consonants I Python O(n) O(1) Explanation
3324 Find the Sequence of Strings Appeared on the Screen JavaScript O(n) O(1) Explanation
3334 Find the Maximum Factor Score of Array JavaScript O(n) O(1) Explanation
3335 Total Characters in String After Transformations I Python O(n) O(1) Explanation
3355 Zero Array Transformation I JavaScript O(n) O(1) Explanation
3356 Zero Array Transformation II Python O(n) O(1) Explanation
3397 Maximum Number of Distinct Elements After Operations JavaScript O(n) O(1) Explanation
3412 Find Mirror Score of a String Python O(n) O(1) Explanation
3424 Minimum Cost to Make Arrays Identical JavaScript O(n) O(1) Explanation
3439 Reschedule Meetings for Maximum Free Time I Python O(n) O(1) Explanation
3440 Reschedule Meetings for Maximum Free Time II Python O(n) O(1) Explanation
3457 Eat Pizzas! JavaScript O(n) O(1) Explanation
3458 Select K Disjoint Special Substrings JavaScript O(n) O(1) Explanation
3475 DNA Pattern Recognition Python O(n) O(1) Explanation
3493 Properties Graph Python O(n) O(1) Explanation
3497 Analyze Subscription Conversion Python O(n) O(1) Explanation
3523 Make Array Non-decreasing Python O(n) O(1) Explanation
3528 Unit Conversion I JavaScript O(n) O(1) Explanation
3557 Find Maximum Number of Non Intersecting Substrings JavaScript O(n) O(1) Explanation
3564 Seasonal Sales Analysis Python O(n) O(1) Explanation
3566 Partition Array into Two Equal Product Subsets Python O(n) O(1) Explanation
3572 Maximize Y‑Sum by Picking a Triplet of Distinct X‑Values JavaScript O(n) O(1) Explanation
3576 Transform Array to All Equal Elements JavaScript O(n) O(1) Explanation
3586 Find COVID Recovery Patients Python O(n) O(1) Explanation
3587 Minimum Adjacent Swaps to Alternate Parity JavaScript O(n) O(1) Explanation
3589 Count Prime-Gap Balanced Subarrays JavaScript O(n) O(1) Explanation
3597 Partition String Python O(n) O(1) Explanation
3611 Find Overbooked Employees Python O(n) O(1) Explanation
3645 Maximum Total from Optimal Activation Order JavaScript O(n) O(1) Explanation
3675 Minimum Operations to Transform String JavaScript O(n) O(1) Explanation
3680 Generate Schedule JavaScript O(n) O(1) Explanation
3690 Split and Merge Array Transformation Python O(n) O(1) Explanation
3698 Split Array With Minimum Difference Python O(n) O(1) Explanation
3703 Remove K-Balanced Substrings Python O(n) O(1) Explanation
3713 Longest Balanced Substring I Python O(n) O(1) Explanation
3714 Longest Balanced Substring II Python O(n) O(1) Explanation
3719 Longest Balanced Subarray I Python O(n) O(1) Explanation
3722 Lexicographically Smallest String After Reverse Python O(n) O(1) Explanation
3732 Maximum Product of Three Elements After One Replacement JavaScript O(n) O(1) Explanation
3767 Maximize Points After Choosing K Tasks JavaScript O(n) O(1) Explanation
3771 Total Score of Dungeon Runs Python O(n) O(1) Explanation
3775 Reverse Words With Same Vowel Count Python O(n) O(1) Explanation
3776 Minimum Moves to Balance Circular Array JavaScript O(n) O(1) Explanation
3780 Maximum Sum of Three Numbers Divisible by Three JavaScript O(n) O(1) Explanation
3784 Minimum Deletion Cost to Make All Characters Equal Python O(n) O(1) Explanation
3788 Maximum Score of a Split Python O(n) O(1) Explanation
3796 Find Maximum Value in a Constrained Sequence JavaScript O(n) O(1) Explanation
3799 Word Squares II Python O(n) O(1) Explanation
3804 Number of Centered Subarrays Python O(n) O(1) Explanation
3810 Minimum Operations to Reach Target Array JavaScript O(n) O(1) Explanation
3814 Maximum Capacity Within Budget Python O(n) O(1) Explanation
3824 Minimum K to Reduce Array Within Limit Python O(n) O(1) Explanation
3828 Final Element After Subarray Deletions Python O(n) O(1) Explanation
3829 Design Ride Sharing System Python O(n) O(1) Explanation
3834 Merge Adjacent Equal Elements Python O(n) O(1) Explanation
3835 Count Subarrays With Cost Less Than or Equal to K JavaScript O(n) O(1) Explanation
3847 Find the Score Difference in a Game Python O(n) O(1) Explanation
3854 Minimum Operations to Make Array Parity Alternating JavaScript O(n) O(1) Explanation
3862 Find the Smallest Balanced Index Python O(n) O(1) Explanation
3871 Count Commas in Range II JavaScript O(n) O(1) Explanation
3881 Direction Assignments with Exactly K Visible People C++ O(n) O(1) Explanation
3891 Minimum Increase to Maximize Special Indices Python O(n) O(1) Explanation
3896 Minimum Operations to Transform Array into Alternating Prime JavaScript O(n) O(1) Explanation
3914 Minimum Operations to Make Array Non Decreasing JavaScript O(n) O(1) Explanation
3923 Minimum Generations to Target Point Python O(n) O(1) Explanation
3927 Minimize Array Sum Using Divisible Replacements JavaScript O(n) O(1) Explanation
3932 Count K-th Roots in a Range Python O(n) O(1) Explanation
3937 Minimum Operations to Make Array Modulo Alternating I Python O(n) O(1) Explanation
3946 Maximum Number of Items From Sale I Python O(n) O(1) Explanation
3947 Maximum Number of Items From Sale II JavaScript O(n) O(1) Explanation
3952 Maximum Total Value of Covered Indices JavaScript O(n) O(1) Explanation
3961 Maximize Sum of Device Ratings Python O(n) O(1) Explanation
3964 Minimum Lights to Illuminate a Road Python O(n) O(1) Explanation
3974 Maximum Total Sum of K Selected Elements JavaScript O(n) O(1) Explanation
3987 Minimum Total Cost to Process All Elements Python O(n) O(1) Explanation
3993 Maximum Value of an Alternating Sequence JavaScript O(n) O(1) Explanation
3994 Minimum Adjacent Swaps to Partition Array JavaScript O(n) O(1) Explanation
4012 Count of Unfinished Tasks After Each Shift Python O(n) O(1) Explanation
4014 Minimum Total Price After Applying Discounts JavaScript O(n) O(1) Explanation
4025 Minimize the Maximum Waiting Time at Synchronized Traffic Lights JavaScript O(n) O(1) Explanation
4026 Maximum Gap Between Stations JavaScript O(n) O(1) Explanation
4035 Maximum Valid Split Positions I JavaScript O(n) O(1) Explanation
4039 Sum of Decoded Numbers Python O(n) O(1) Explanation
4067 Longest Subarray With Restricted Pair Sums Python O(n) O(1) Explanation

Hard

# Problem Language Time Space Explanation
41 First Missing Positive JavaScript, Python O(n) O(1) Explanation
44 Wildcard Matching Python O(n) O(1) Explanation
65 Valid Number Python O(n) O(1) Explanation
273 Integer to English Words Python O(n) O(1) Explanation
330 Patching Array Python O(n) O(1) Explanation
335 Self Crossing Python O(n) O(1) Explanation
403 Frog Jump Python O(n) O(1) Explanation
407 Trapping Rain Water II Python O(n) O(1) Explanation
410 Split Array Largest Sum Python O(n) O(1) Explanation
440 K-th Smallest in Lexicographical Order Python O(n) O(1) Explanation
458 Poor Pigs Python O(n) O(1) Explanation
600 Non-negative Integers without Consecutive Ones Python O(n) O(1) Explanation
630 Course Schedule III Python O(n) O(1) Explanation
639 Decode Ways II Python O(n) O(1) Explanation
668 Kth Smallest Number in Multiplication Table Python O(n) O(1) Explanation
689 Maximum Sum of 3 Non-Overlapping Subarrays Python O(n) O(1) Explanation
719 Find K-th Smallest Pair Distance Python O(n) O(1) Explanation
757 Set Intersection Size At Least Two Python O(n) O(1) Explanation
765 Couples Holding Hands Python O(n) O(1) Explanation
778 Swim in Rising Water Python O(n) O(1) Explanation
780 Reaching Points Python O(n) O(1) Explanation
793 Preimage Size of Factorial Zeroes Function Python O(n) O(1) Explanation
798 Smallest Rotation with Highest Score Python O(n) O(1) Explanation
803 Bricks Falling When Hit Python O(n) O(1) Explanation
839 Similar String Groups Python O(n) O(1) Explanation
843 Guess the Word Python O(n) O(1) Explanation
854 K-Similar Strings Python O(n) O(1) Explanation
857 Minimum Cost to Hire K Workers Python O(n) O(1) Explanation
871 Minimum Number of Refueling Stops Python O(n) O(1) Explanation
913 Cat and Mouse Python O(n) O(1) Explanation
964 Least Operators to Express Number Python O(n) O(1) Explanation
972 Equal Rational Numbers Python O(n) O(1) Explanation
1096 Brace Expansion II JavaScript O(n) O(1) Explanation
1203 Sort Items by Groups Respecting Dependencies JavaScript O(n) O(1) Explanation
1298 Maximum Candies You Can Get from Boxes JavaScript O(n) O(1) Explanation
1316 Distinct Echo Substrings Python O(n) O(1) Explanation
1326 Minimum Number of Taps to Open to Water a Garden Python O(n) O(1) Explanation
1363 Largest Multiple of Three Python O(n) O(1) Explanation
1383 Maximum Performance of a Team Python O(n) O(1) Explanation
1388 Pizza With 3n Slices Python O(n) O(1) Explanation
1402 Reducing Dishes Python O(n) O(1) Explanation
1537 Get the Maximum Score Python O(n) O(1) Explanation
1542 Find Longest Awesome Substring Python O(n) O(1) Explanation
1547 Minimum Cost to Cut a Stick JavaScript O(n) O(1) Explanation
1579 Remove Max Number of Edges to Keep Graph Fully Traversable Python O(n) O(1) Explanation
1622 Fancy Sequence JavaScript O(n) O(1) Explanation
1627 Graph Connectivity With Threshold Python O(n) O(1) Explanation
1671 Minimum Number of Removals to Make Mountain Array Python O(n) O(1) Explanation
1675 Minimize Deviation in Array Python O(n) O(1) Explanation
1739 Building Boxes Python O(n) O(1) Explanation
1751 Maximum Number of Events That Can Be Attended II Python O(n) O(1) Explanation
1830 Minimum Number of Operations to Make String Sorted Python O(n) O(1) Explanation
1970 Last Day Where You Can Still Cross Python O(n) O(1) Explanation
1998 GCD Sort of an Array Python O(n) O(1) Explanation
2009 Minimum Number of Operations to Make Array Continuous Python O(n) O(1) Explanation
2076 Process Restricted Friend Requests Python O(n) O(1) Explanation
2111 Minimum Operations to Make the Array K-Increasing Python O(n) O(1) Explanation
2136 Earliest Possible Day of Full Bloom Python O(n) O(1) Explanation
2223 Sum of Scores of Built Strings Python O(n) O(1) Explanation
2296 Design a Text Editor Python O(n) O(1) Explanation
2306 Naming a Company Python O(n) O(1) Explanation
2350 Shortest Impossible Sequence of Rolls Python O(n) O(1) Explanation
2366 Minimum Replacements to Sort the Array Python O(n) O(1) Explanation
2386 Find the K-Sum of an Array JavaScript O(n) O(1) Explanation
2412 Minimum Money Required Before Transactions Python O(n) O(1) Explanation
2448 Minimum Cost to Make Array Equal Python O(n) O(1) Explanation
2463 Minimum Total Distance Traveled JavaScript O(n) O(1) Explanation
2478 Number of Beautiful Partitions JavaScript O(n) O(1) Explanation
2551 Put Marbles in Bags Python O(n) O(1) Explanation
2561 Rearranging Fruits Python O(n) O(1) Explanation
2650 Design Cancellable Function TypeScript O(n) O(1) Explanation
2663 Lexicographically Smallest Beautiful String Python O(n) O(1) Explanation
2681 Power of Heroes JavaScript O(n) O(1) Explanation
2699 Modify Graph Edge Weights JavaScript O(n) O(1) Explanation
2763 Sum of Imbalance Numbers of All Subarrays Python O(n) O(1) Explanation
2790 Maximum Number of Groups With Increasing Length Python O(n) O(1) Explanation
2931 Maximum Spending After Buying Items Python O(n) O(1) Explanation
2954 Count the Number of Infection Sequences Python O(n) O(1) Explanation
2959 Number of Possible Sets of Closing Branches JavaScript O(n) O(1) Explanation
2972 Count the Number of Incremovable Subarrays II Python O(n) O(1) Explanation
3027 Find the Number of Ways to Place People II Python O(n) O(1) Explanation
3031 Minimum Time to Revert Word to Initial State II Python O(n) O(1) Explanation
3036 Number of Subarrays That Match a Pattern II Python O(n) O(1) Explanation
3139 Minimum Cost to Equalize Array Python O(n) O(1) Explanation
3219 Minimum Cost for Cutting Cake II JavaScript O(n) O(1) Explanation
3229 Minimum Operations to Make Array Equal to Target Python O(n) O(1) Explanation
3273 Minimum Amount of Damage Dealt to Bob JavaScript O(n) O(1) Explanation
3307 Find the K-th Character in String Game II Python O(n) O(1) Explanation
3374 First Letter Capitalization II Python O(n) O(1) Explanation
3405 Count the Number of Arrays with K Matching Adjacent Elements JavaScript O(n) O(1) Explanation
3510 Minimum Pair Removal to Sort Array II Python O(n) O(1) Explanation
3547 Maximum Sum of Edge Values in a Graph JavaScript O(n) O(1) Explanation
3725 Count Ways to Choose Coprime Integers from Rows JavaScript O(n) O(1) Explanation
3782 Last Remaining Integer After Alternating Deletion Operations Python O(n) O(1) Explanation
3948 Lexicographically Maximum MEX Array JavaScript O(n) O(1) Explanation
3971 Maximum Total Value Python O(n) O(1) Explanation
3985 Palindromic Subarray Sum Python O(n) O(1) Explanation