Algorithms > Fundamental¶
Backtracking¶
- 3437. Permutations III
- 3376. Minimum Time to Break Locks I
- 3348. Smallest Divisible Digit Product II
- 3211. Generate Binary Strings Without Adjacent Zeros
- 2992. Number of Self-Divisible Permutations
- 2767. Partition String Into Minimum Beautiful Substrings
- 2708. Maximum Strength of a Group
- 2698. Find the Punishment Number of an Integer
- 2664. The Knight’s Tour
- 2597. The Number of Beautiful Subsets
- 2397. Maximum Rows Covered by Columns
- 2375. Construct Smallest Number From DI String
- 2305. Fair Distribution of Cookies
- 2212. Maximum Points in an Archery Competition
- 2178. Maximum Split of Positive Even Integers
- 2152. Minimum Number of Lines to Cover Points
- 2151. Maximum Good People Based on Statements
- 2065. Maximum Path Quality of a Graph
- 2056. Number of Valid Move Combinations On Chessboard
- 2048. Next Greater Numerically Balanced Number
- 2044. Count Number of Maximum Bitwise-OR Subsets
- 2014. Longest Subsequence Repeated k Times
- 2002. Maximum Product of the Length of Two Palindromic Subsequences
- 1986. Minimum Number of Work Sessions to Finish the Tasks
- 1980. Find Unique Binary String
- 1947. Maximum Compatibility Score Sum
- 1863. Sum of All Subset XOR Totals
- 1849. Splitting a String Into Descending Consecutive Values
- 1799. Maximize Score After N Operations
- 1774. Closest Dessert Cost
- 1723. Find Minimum Time to Finish All Jobs
- 1718. Construct the Lexicographically Largest Valid Sequence
- 1655. Distribute Repeating Integers
- 1601. Maximum Number of Achievable Transfer Requests
- 1593. Split a String Into the Max Number of Unique Substrings
- 1467. Probability of a Two Boxes Having The Same Number of Distinct Balls
- 1415. The k-th Lexicographical String of All Happy Strings of Length n
- 1307. Verbal Arithmetic Puzzle
- 1286. Iterator for Combination
- 1258. Synonymous Sentences
- 1255. Maximum Score Words Formed by Letters
- 1240. Tiling a Rectangle with the Fewest Squares
- 1239. Maximum Length of a Concatenated String with Unique Characters
- 1238. Circular Permutation in Binary Representation
- 1219. Path with Maximum Gold
- 1215. Stepping Numbers
- 1096. Brace Expansion II
- 1088. Confusing Number II
- 1087. Brace Expansion
- 1079. Letter Tile Possibilities
- 1066. Campus Bikes II
- 996. Number of Squareful Arrays
- 988. Smallest String Starting From Leaf
- 980. Unique Paths III
- 967. Numbers With Same Consecutive Differences
- 949. Largest Time for Given Digits
- 842. Split Array into Fibonacci Sequence
- 816. Ambiguous Coordinates
- 797. All Paths From Source to Target
- 784. Letter Case Permutation
- 773. Sliding Puzzle
- 698. Partition to K Equal Sum Subsets
- 691. Stickers to Spell Word
- 681. Next Closest Time
- 679. 24 Game
- 638. Shopping Offers
- 526. Beautiful Arrangement
- 494. Target Sum
- 491. Non-decreasing Subsequences
- 489. Robot Room Cleaner
- 473. Matchsticks to Square
- 465. Optimal Account Balancing
- 425. Word Squares
- 411. Minimum Unique Word Abbreviation
- 401. Binary Watch
- 357. Count Numbers with Unique Digits
- 351. Android Unlock Patterns
- 320. Generalized Abbreviation
- 306. Additive Number
- 301. Remove Invalid Parentheses
- 294. Flip Game II
- 291. Word Pattern II
- 282. Expression Add Operators
- 267. Palindrome Permutation II
- 257. Binary Tree Paths
- 254. Factor Combinations
- 216. Combination Sum III
- 212. Word Search II
- 140. Word Break II
- 131. Palindrome Partitioning
- 126. Word Ladder II
- 113. Path Sum II
- 95. Unique Binary Search Trees II
- 93. Restore IP Addresses
- 90. Subsets II
- 89. Gray Code
- 79. Word Search
- 78. Subsets
- 77. Combinations
- 52. N-Queens II
- 51. N-Queens
- 47. Permutations II
- 46. Permutations
- 40. Combination Sum II
- 39. Combination Sum
- 37. Sudoku Solver
- 22. Generate Parentheses
- 17. Letter Combinations of a Phone Number
Divide and Conquer¶
- 3165. Maximum Sum of Subsequence With Non-adjacent Elements
- 3109. Find the Index of Permutation
- 2792. Count Nodes That Are Great Enough
- 2613. Beautiful Pairs
- 2519. Count the Number of K-Big Indices
- 2426. Number of Pairs Satisfying Inequality
- 2407. Longest Increasing Subsequence II
- 2343. Query Kth Smallest Trimmed Number
- 2179. Count Good Triplets in an Array
- 2031. Count Subarrays With More Ones Than Zeros
- 1985. Find the Kth Largest Integer in the Array
- 1982. Find Array Given Subset Sums
- 1763. Longest Nice Substring
- 1738. Find Kth Largest XOR Coordinate Value
- 1649. Create Sorted Array through Instructions
- 1569. Number of Ways to Reorder Array to Get Same BST
- 1382. Balance a Binary Search Tree
- 1274. Number of Ships in a Rectangle
- 973. K Closest Points to Origin
- 932. Beautiful Array
- 918. Maximum Sum Circular Subarray
- 912. Sort an Array
- 889. Construct Binary Tree from Preorder and Postorder Traversal
- 654. Maximum Binary Tree
- 558. Logical OR of Two Binary Grids Represented as Quad-Trees
- 493. Reverse Pairs
- 427. Construct Quad Tree
- 395. Longest Substring with At Least K Repeating Characters
- 372. Super Pow
- 347. Top K Frequent Elements
- 327. Count of Range Sum
- 324. Wiggle Sort II
- 315. Count of Smaller Numbers After Self
- 240. Search a 2D Matrix II
- 218. The Skyline Problem
- 215. Kth Largest Element in an Array
- 191. Number of 1 Bits
- 190. Reverse Bits
- 169. Majority Element
- 148. Sort List
- 109. Convert Sorted List to Binary Search Tree
- 108. Convert Sorted Array to Binary Search Tree
- 106. Construct Binary Tree from Inorder and Postorder Traversal
- 105. Construct Binary Tree from Preorder and Inorder Traversal
- 53. Maximum Subarray
- 23. Merge k Sorted Lists
- 4. Median of Two Sorted Arrays
Greedy¶
- 3496. Maximize Score After Pair Deletions
- 3487. Maximum Unique Subarray Sum After Deletion
- 3476. Maximize Profit from Task Assignment
- 3474. Lexicographically Smallest Generated String
- 3464. Maximize the Distance Between Points on a Square
- 3462. Maximum Sum With at Most K Elements
- 3458. Select K Disjoint Special Substrings
- 3457. Eat Pizzas!
- 3449. Maximize the Minimum Game Score
- 3440. Reschedule Meetings for Maximum Free Time II
- 3439. Reschedule Meetings for Maximum Free Time I
- 3434. Maximum Frequency After Subarray Operation
- 3424. Minimum Cost to Make Arrays Identical
- 3413. Maximum Coins From K Consecutive Bags
- 3402. Minimum Operations to Make Columns Strictly Increasing
- 3397. Maximum Number of Distinct Elements After Operations
- 3362. Zero Array Transformation III
- 3357. Minimize the Maximum Adjacent Element Difference
- 3348. Smallest Divisible Digit Product II
- 3326. Minimum Division Operations to Make Array Non Decreasing
- 3302. Find the Lexicographically Smallest Valid Sequence
- 3301. Maximize the Total Height of Unique Towers
- 3296. Minimum Number of Seconds to Make Mountain Height Zero
- 3282. Reach End of Array With Max Score
- 3281. Maximize Score of Numbers in Ranges
- 3273. Minimum Amount of Damage Dealt to Bob
- 3260. Find the Largest Palindrome Divisible by K
- 3244. Shortest Distance After Road Addition Queries II
- 3229. Minimum Operations to Make Array Equal to Target
- 3228. Maximum Number of Operations to Move Ones to the End
- 3221. Maximum Array Hopping Score II
- 3219. Minimum Cost for Cutting Cake II
- 3218. Minimum Cost for Cutting Cake I
- 3216. Lexicographically Smallest String After a Swap
- 3207. Maximum Points After Enemy Battles
- 3205. Maximum Array Hopping Score I
- 3192. Minimum Operations to Make Binary Array Elements Equal to One II
- 3189. Minimum Moves to Get a Peaceful Board
- 3170. Lexicographically Minimum String After Removing Stars
- 3139. Minimum Cost to Equalize Array
- 3125. Maximum Number That Makes Result of Bitwise AND Zero
- 3119. Maximum Number of Potholes That Can Be Fixed
- 3111. Minimum Rectangles to Cover Points
- 3107. Minimum Operations to Make Median of Array Equal to K
- 3106. Lexicographically Smallest String After Operations With Constraint
- 3091. Apply Operations to Make Sum of Array Greater Than or Equal to k
- 3088. Make String Anti-palindrome
- 3086. Minimum Moves to Pick K Ones
- 3085. Minimum Deletions to Make String K-Special
- 3081. Replace Question Marks in String to Minimize Its Value
- 3075. Maximize Happiness of Selected Children
- 3074. Apple Redistribution into Boxes
- 3068. Find the Maximum Sum of Node Values
- 3049. Earliest Second to Mark Indices II
- 3035. Maximum Palindromes After Operations
- 3022. Minimize OR of Remaining Elements Using Operations
- 3016. Minimum Number of Pushes to Type Word II
- 3014. Minimum Number of Pushes to Type Word I
- 3012. Minimize Length of Array Using Operations
- 3002. Maximum Size of a Set After Removals
- 2971. Find Polygon With the Largest Perimeter
- 2967. Minimum Cost to Make Array Equalindromic
- 2966. Divide Array Into Arrays With Max Difference
- 2957. Remove Adjacent Almost-Equal Characters
- 2952. Minimum Number of Coins to be Added
- 2939. Maximum Xor Product
- 2938. Separate Black and White Balls
- 2931. Maximum Spending After Buying Items
- 2918. Minimum Equal Sum of Two Arrays After Replacing Zeros
- 2910. Minimum Number of Groups to Create a Valid Assignment
- 2900. Longest Unequal Adjacent Groups Subsequence I
- 2897. Apply Operations on Array to Maximize Sum of Squares
- 2895. Minimum Processing Time
- 2892. Minimizing Array After Replacing Pairs With Their Product
- 2871. Split Array Into Maximum Number of Subarrays
- 2870. Minimum Number of Operations to Make Array Empty
- 2868. The Wording Game
- 2864. Maximum Odd Binary Number
- 2856. Minimum Array Length After Pair Removals
- 2847. Smallest Number With Given Digit Product
- 2844. Minimum Operations to Make a Special Number
- 2842. Count K-Subsequences of a String With Maximum Beauty
- 2835. Minimum Operations to Form Subsequence With Target Sum
- 2834. Find the Minimum Possible Sum of a Beautiful Array
- 2829. Determine the Minimum Sum of a k-avoiding Array
- 2818. Apply Operations to Maximize Score
- 2813. Maximum Elegance of a K-Length Subsequence
- 2811. Check if it is Possible to Split Array
- 2800. Shortest String That Contains Three Strings
- 2790. Maximum Number of Groups With Increasing Length
- 2789. Largest Element in an Array after Merge Operations
- 2745. Construct the Longest New String
- 2734. Lexicographically Smallest String After Substring Operation
- 2712. Minimum Cost to Make All Characters Equal
- 2708. Maximum Strength of a Group
- 2706. Buy Two Chocolates
- 2697. Lexicographically Smallest Palindrome
- 2680. Maximum OR
- 2673. Make Costs of Paths Equal in a Binary Tree
- 2663. Lexicographically Smallest Beautiful String
- 2659. Make Array Empty
- 2656. Maximum Sum With Exactly K Elements
- 2645. Minimum Additions to Make Valid String
- 2616. Minimize the Maximum Difference of Pairs
- 2611. Mice and Cheese
- 2607. Make K-Subarray Sums Equal
- 2601. Prime Subtraction Operation
- 2600. K Items With the Maximum Sum
- 2599. Make the Prefix Sum Non-negative
- 2598. Smallest Missing Non-negative Integer After Operations
- 2592. Maximize Greatness of an Array
- 2591. Distribute Money to Maximum Children
- 2589. Minimum Time to Complete All Tasks
- 2587. Rearrange Array to Maximize Prefix Score
- 2578. Split With Minimum Sum
- 2576. Find the Maximum Number of Marked Indices
- 2573. Find the String with LCP
- 2571. Minimum Operations to Reduce an Integer to 0
- 2567. Minimum Score by Changing Two Elements
- 2566. Maximum Difference by Remapping a Digit
- 2561. Rearranging Fruits
- 2557. Maximum Number of Integers to Choose From a Range II
- 2554. Maximum Number of Integers to Choose From a Range I
- 2551. Put Marbles in Bags
- 2548. Maximum Price to Fill a Bag
- 2542. Maximum Subsequence Score
- 2541. Minimum Operations to Make Array Equal II
- 2530. Maximal Score After Applying K Operations
- 2528. Maximize the Minimum Powered City
- 2522. Partition String Into Substrings With Values at Most K
- 2517. Maximum Tastiness of Candy Basket
- 2499. Minimum Total Cost to Make Arrays Unequal
- 2498. Frog Jump II
- 2497. Maximum Star Sum of a Graph
- 2486. Append Characters to String to Make Subsequence
- 2472. Maximum Number of Non-overlapping Palindrome Substrings
- 2459. Sort Array by Moving Items to Empty Space
- 2457. Minimum Addition to Make Integer Beautiful
- 2449. Minimum Number of Operations to Make Arrays Similar
- 2448. Minimum Cost to Make Array Equal
- 2439. Minimize Maximum of Array
- 2436. Minimum Split Into Subarrays With GCD Greater Than One
- 2434. Using a Robot to Print the Lexicographically Smallest String
- 2429. Minimize XOR
- 2422. Merge Operations to Turn Array Into a Palindrome
- 2412. Minimum Money Required Before Transactions
- 2410. Maximum Matching of Players With Trainers
- 2406. Divide Intervals Into Minimum Number of Groups
- 2405. Optimal Partition of String
- 2389. Longest Subsequence With Limited Sum
- 2384. Largest Palindromic Number
- 2383. Minimum Hours of Training to Win a Competition
- 2375. Construct Smallest Number From DI String
- 2366. Minimum Replacements to Sort the Array
- 2358. Maximum Number of Groups Entering a Competition
- 2357. Make Array Zero by Subtracting Equal Amounts
- 2350. Shortest Impossible Sequence of Rolls
- 2340. Minimum Adjacent Swaps to Make a Valid Array
- 2335. Minimum Amount of Time to Fill Cups
- 2333. Minimum Sum of Squared Difference
- 2323. Find Minimum Time to Finish All Jobs II
- 2311. Longest Binary Subsequence Less Than or Equal to K
- 2310. Sum of Numbers With Units Digit K
- 2294. Partition Array Such That Maximum Difference Is K
- 2285. Maximum Total Importance of Roads
- 2279. Maximum Bags With Full Capacity of Rocks
- 2271. Maximum White Tiles Covered by a Carpet
- 2268. Minimum Number of Keypresses
- 2263. Make Array Non-decreasing or Non-increasing
- 2259. Remove Digit From Number to Maximize Result
- 2244. Minimum Rounds to Complete All Tasks
- 2241. Design an ATM Machine
- 2234. Maximum Total Beauty of the Gardens
- 2233. Maximum Product After K Increments
- 2224. Minimum Number of Operations to Convert Time
- 2216. Minimum Deletions to Make Array Beautiful
- 2214. Minimum Health to Beat Game
- 2208. Minimum Operations to Halve Array Sum
- 2207. Maximize Number of Subsequences in a String
- 2202. Maximize the Topmost Element After K Moves
- 2195. Append K Integers With Minimal Sum
- 2193. Minimum Number of Moves to Make Palindrome
- 2182. Construct String With Repeat Limit
- 2178. Maximum Split of Positive Even Integers
- 2171. Removing Minimum Number of Magic Beans
- 2170. Minimum Operations to Make the Array Alternating
- 2160. Minimum Sum of Four Digit Number After Splitting Digits
- 2144. Minimum Cost of Buying Candies With Discount
- 2141. Maximum Running Time of N Computers
- 2139. Minimum Moves to Reach Target Score
- 2136. Earliest Possible Day of Full Bloom
- 2132. Stamping the Grid
- 2131. Longest Palindrome by Concatenating Two Letter Words
- 2126. Destroying Asteroids
- 2116. Check if a Parentheses String Can Be Valid
- 2098. Subsequence of Size K With the Largest Even Sum
- 2091. Removing Minimum and Maximum From Array
- 2087. Minimum Cost Homecoming of a Robot in a Grid
- 2086. Minimum Number of Food Buckets to Feed the Hamsters
- 2078. Two Furthest Houses With Different Colors
- 2071. Maximum Number of Tasks You Can Assign
- 2064. Minimized Maximum of Products Distributed to Any Store
- 2038. Remove Colored Pieces if Both Neighbors are the Same Color
- 2037. Minimum Number of Moves to Seat Everyone
- 2030. Smallest K-Length Subsequence With Occurrences of a Letter
- 2029. Stone Game IX
- 2027. Minimum Moves to Convert String
- 2015. Average Height of Buildings in Each Segment
- 2014. Longest Subsequence Repeated k Times
- 2007. Find Original Array From Doubled Array
- 1996. The Number of Weak Characters in the Game
- 1989. Maximum Number of People That Can Be Caught in Tag
- 1975. Maximum Matrix Sum
- 1974. Minimum Time to Type Word Using Special Typewriter
- 1969. Minimum Non-Zero Product of the Array Elements
- 1968. Array With Elements Not Equal to Average of Neighbors
- 1963. Minimum Number of Swaps to Make the String Balanced
- 1962. Remove Stones to Minimize the Total
- 1953. Maximum Number of Weeks for Which You Can Work
- 1946. Largest Number After Mutating Substring
- 1936. Add Minimum Number of Rungs
- 1927. Sum Game
- 1921. Eliminate Maximum Number of Monsters
- 1903. Largest Odd Number in String
- 1899. Merge Triplets to Form Target Triplet
- 1888. Minimum Number of Flips to Make the Binary String Alternating
- 1881. Maximum Value after Insertion
- 1877. Minimize Maximum Pair Sum in Array
- 1874. Minimize Product Sum of Two Arrays
- 1864. Minimum Number of Swaps to Make the Binary String Alternating
- 1850. Minimum Adjacent Swaps to Reach the Kth Smallest Number
- 1846. Maximum Element After Decreasing and Rearranging
- 1838. Frequency of the Most Frequent Element
- 1833. Maximum Ice Cream Bars
- 1827. Minimum Operations to Make the Array Increasing
- 1824. Minimum Sideway Jumps
- 1802. Maximum Value at a Given Index in a Bounded Array
- 1798. Maximum Number of Consecutive Values You Can Make
- 1794. Count Pairs of Equal Substrings With Minimum Difference
- 1792. Maximum Average Pass Ratio
- 1788. Maximize the Beauty of the Garden
- 1785. Minimum Elements to Add to Form a Given Sum
- 1775. Equal Sum Arrays With Minimum Number of Operations
- 1764. Form Array by Concatenating Subarrays of Another Array
- 1754. Largest Merge Of Two Strings
- 1753. Maximum Score From Removing Stones
- 1739. Building Boxes
- 1736. Latest Time by Replacing Hidden Digits
- 1733. Minimum Number of People to Teach
- 1727. Largest Submatrix With Rearrangements
- 1717. Maximum Score From Removing Substrings
- 1713. Minimum Operations to Make a Subsequence
- 1710. Maximum Units on a Truck
- 1708. Largest Subarray Length K
- 1705. Maximum Number of Eaten Apples
- 1703. Minimum Adjacent Swaps for K Consecutive Ones
- 1702. Maximum Binary String After Change
- 1689. Partitioning Into Minimum Number Of Deci-Binary Numbers
- 1686. Stone Game VI
- 1675. Minimize Deviation in Array
- 1673. Find the Most Competitive Subsequence
- 1671. Minimum Number of Removals to Make Mountain Array
- 1665. Minimum Initial Energy to Finish Tasks
- 1663. Smallest String With A Given Numeric Value
- 1648. Sell Diminishing-Valued Colored Balls
- 1647. Minimum Deletions to Make Character Frequencies Unique
- 1642. Furthest Building You Can Reach
- 1606. Find Servers That Handled Most Number of Requests
- 1605. Find Valid Matrix Given Row and Column Sums
- 1589. Maximum Sum Obtained of Any Permutation
- 1585. Check If String Is Transformable With Substring Sort Operations
- 1580. Put Boxes Into the Warehouse II
- 1578. Minimum Time to Make Rope Colorful
- 1567. Maximum Length of Subarray With Positive Product
- 1564. Put Boxes Into the Warehouse I
- 1561. Maximum Number of Coins You Can Get
- 1558. Minimum Numbers of Function Calls to Make Target Array
- 1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
- 1541. Minimum Insertions to Balance a Parentheses String
- 1537. Get the Maximum Score
- 1536. Minimum Swaps to Arrange a Binary Grid
- 1529. Minimum Suffix Flips
- 1526. Minimum Number of Increments on Subarrays to Form a Target Array
- 1520. Maximum Number of Non-Overlapping Substrings
- 1509. Minimum Difference Between Largest and Smallest Value in Three Moves
- 1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits
- 1488. Avoid Flood in The City
- 1481. Least Number of Unique Integers after K Removals
- 1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
- 1433. Check If a String Can Break Another String
- 1432. Max Difference You Can Get From Changing an Integer
- 1414. Find the Minimum Number of Fibonacci Numbers Whose Sum Is K
- 1405. Longest Happy String
- 1403. Minimum Subsequence in Non-Increasing Order
- 1402. Reducing Dishes
- 1400. Construct K Palindrome Strings
- 1388. Pizza With 3n Slices
- 1386. Cinema Seat Allocation
- 1383. Maximum Performance of a Team
- 1382. Balance a Binary Search Tree
- 1363. Largest Multiple of Three
- 1353. Maximum Number of Events That Can Be Attended
- 1338. Reduce Array Size to The Half
- 1330. Reverse Subarray To Maximize Array Value
- 1328. Break a Palindrome
- 1326. Minimum Number of Taps to Open to Water a Garden
- 1323. Maximum 69 Number
- 1296. Divide Array in Sets of K Consecutive Numbers
- 1282. Group the People Given the Group Size They Belong To
- 1262. Greatest Sum Divisible by Three
- 1253. Reconstruct a 2-Row Binary Matrix
- 1247. Minimum Swaps to Make Strings Equal
- 1221. Split a String in Balanced Strings
- 1217. Minimum Cost to Move Chips to The Same Position
- 1199. Minimum Time to Build Blocks
- 1196. How Many Apples Can You Put into the Basket
- 1183. Maximum Number of Ones
- 1167. Minimum Cost to Connect Sticks
- 1147. Longest Chunked Palindrome Decomposition
- 1144. Decrease Elements To Make Array Zigzag
- 1130. Minimum Cost Tree From Leaf Values
- 1090. Largest Values From Labels
- 1081. Smallest Subsequence of Distinct Characters
- 1058. Minimize Rounding Error to Meet Target
- 1055. Shortest Way to Form String
- 1054. Distant Barcodes
- 1053. Previous Permutation With One Swap
- 1029. Two City Scheduling
- 1024. Video Stitching
- 1013. Partition Array Into Three Parts With Equal Sum
- 1007. Minimum Domino Rotations For Equal Row
- 1005. Maximize Sum Of Array After K Negations
- 991. Broken Calculator
- 984. String Without AAA or BBB
- 976. Largest Perimeter Triangle
- 969. Pancake Sorting
- 955. Delete Columns to Make Sorted II
- 954. Array of Doubled Pairs
- 948. Bag of Tokens
- 945. Minimum Increment to Make Array Unique
- 942. DI String Match
- 936. Stamping The Sequence
- 921. Minimum Add to Make Parentheses Valid
- 910. Smallest Range II
- 881. Boats to Save People
- 871. Minimum Number of Refueling Stops
- 870. Advantage Shuffle
- 861. Score After Flipping Matrix
- 860. Lemonade Change
- 857. Minimum Cost to Hire K Workers
- 846. Hand of Straights
- 826. Most Profit Assigning Work
- 807. Max Increase to Keep City Skyline
- 781. Rabbits in Forest
- 769. Max Chunks To Make Sorted
- 768. Max Chunks To Make Sorted II
- 767. Reorganize String
- 765. Couples Holding Hands
- 763. Partition Labels
- 757. Set Intersection Size At Least Two
- 738. Monotone Increasing Digits
- 714. Best Time to Buy and Sell Stock with Transaction Fee
- 680. Valid Palindrome II
- 678. Valid Parenthesis String
- 670. Maximum Swap
- 659. Split Array into Consecutive Subsequences
- 649. Dota2 Senate
- 646. Maximum Length of Pair Chain
- 632. Smallest Range Covering Elements from K Lists
- 630. Course Schedule III
- 625. Minimum Factorization
- 624. Maximum Distance in Arrays
- 621. Task Scheduler
- 611. Valid Triangle Number
- 605. Can Place Flowers
- 581. Shortest Unsorted Continuous Subarray
- 561. Array Partition
- 555. Split Concatenated Strings
- 527. Word Abbreviation
- 517. Super Washing Machines
- 502. IPO
- 484. Find Permutation
- 455. Assign Cookies
- 452. Minimum Number of Arrows to Burst Balloons
- 435. Non-overlapping Intervals
- 420. Strong Password Checker
- 410. Split Array Largest Sum
- 409. Longest Palindrome
- 402. Remove K Digits
- 397. Integer Replacement
- 376. Wiggle Subsequence
- 358. Rearrange String k Distance Apart
- 334. Increasing Triplet Subsequence
- 330. Patching Array
- 324. Wiggle Sort II
- 321. Create Maximum Number
- 316. Remove Duplicate Letters
- 280. Wiggle Sort
- 253. Meeting Rooms II
- 179. Largest Number
- 135. Candy
- 134. Gas Station
- 122. Best Time to Buy and Sell Stock II
- 55. Jump Game
- 45. Jump Game II
- 44. Wildcard Matching
- 11. Container With Most Water
Prefix Sum¶
- 3500. Minimum Cost to Divide Array Into Subarrays
- 3494. Find the Minimum Amount of Time to Brew Potions
- 3486. Longest Special Path II
- 3480. Maximize Subarrays After Removing One Conflicting Pair
- 3473. Sum of K Subarrays With Length at Least M
- 3445. Maximum Difference Between Even and Odd Frequency II
- 3434. Maximum Frequency After Subarray Operation
- 3432. Count Partitions with Even Sum Difference
- 3427. Sum of Variable Length Subarrays
- 3425. Longest Special Path
- 3413. Maximum Coins From K Consecutive Bags
- 3381. Maximum Subarray Sum With Length Divisible by K
- 3364. Minimum Positive Sum Subarray
- 3362. Zero Array Transformation III
- 3361. Shift Distance Between Two Strings
- 3356. Zero Array Transformation II
- 3355. Zero Array Transformation I
- 3354. Make Array Elements Equal to Zero
- 3347. Maximum Frequency of an Element After Performing Operations II
- 3346. Maximum Frequency of an Element After Performing Operations I
- 3333. Find the Original Typed String II
- 3312. Sorted GCD Pair Queries
- 3279. Maximum Total Area Occupied by Pistons
- 3261. Count Substrings That Satisfy K-Constraint II
- 3251. Find the Count of Monotonic Pairs II
- 3250. Find the Count of Monotonic Pairs I
- 3225. Maximum Score From Grid Operations
- 3224. Minimum Array Changes to Make Differences Equal
- 3212. Count Submatrices With Equal Frequency of X and Y
- 3191. Minimum Operations to Make Binary Array Elements Equal to One I
- 3179. Find the N-th Value After K Seconds
- 3152. Special Array II
- 3147. Taking Maximum Energy From the Mystic Dungeon
- 3130. Find All Possible Stable Binary Arrays II
- 3129. Find All Possible Stable Binary Arrays I
- 3104. Find Longest Self-Contained Substring
- 3096. Minimum Levels to Gain More Points
- 3086. Minimum Moves to Pick K Ones
- 3077. Maximum Strength of K Disjoint Subarrays
- 3070. Count Submatrices with Top-Left Element and Sum Less Than k
- 3028. Ant on the Boundary
- 3026. Maximum Good Subarray Sum
- 3017. Count the Number of Houses at a Certain Distance II
- 3015. Count the Number of Houses at a Certain Distance I
- 2983. Palindrome Rearrangement Queries
- 2971. Find Polygon With the Largest Perimeter
- 2968. Apply Operations to Maximize Frequency Score
- 2955. Number of Same-End Substrings
- 2950. Number of Divisible Substrings
- 2949. Count Beautiful Substrings II
- 2947. Count Beautiful Substrings I
- 2906. Construct Product Matrix
- 2875. Minimum Size Subarray in Infinite Array
- 2848. Points That Intersect With Cars
- 2845. Count of Interesting Subarrays
- 2838. Maximum Coins Heroes Can Collect
- 2819. Minimum Relative Loss After Buying Chocolates
- 2772. Apply Operations to Make All Array Elements Equal to Zero
- 2731. Movement of Robots
- 2681. Power of Heroes
- 2680. Maximum OR
- 2640. Find the Score of All Prefixes of an Array
- 2615. Sum of Distances
- 2602. Minimum Operations to Make All Array Elements Equal
- 2588. Count the Number of Beautiful Subarrays
- 2587. Rearrange Array to Maximize Prefix Score
- 2574. Left and Right Sum Differences
- 2559. Count Vowel Strings in Ranges
- 2552. Count Increasing Quadruplets
- 2536. Increment Submatrices by One
- 2528. Maximize the Minimum Powered City
- 2489. Number of Substrings With Fixed Ratio
- 2488. Count Subarrays With Median K
- 2485. Find the Pivot Integer
- 2483. Minimum Penalty for a Shop
- 2448. Minimum Cost to Make Array Equal
- 2439. Minimize Maximum of Array
- 2438. Range Product Queries of Powers
- 2428. Maximum Sum of an Hourglass
- 2420. Find All Good Indices
- 2406. Divide Intervals Into Minimum Number of Groups
- 2398. Maximum Number of Robots Within Budget
- 2391. Minimum Amount of Time to Collect Garbage
- 2389. Longest Subsequence With Limited Sum
- 2382. Maximum Segment Sum After Removals
- 2381. Shifting Letters II
- 2302. Count Subarrays With Score Less Than K
- 2281. Sum of Total Strength of Wizards
- 2271. Maximum White Tiles Covered by a Carpet
- 2270. Number of Ways to Split Array
- 2256. Minimum Average Difference
- 2251. Number of Flowers in Full Bloom
- 2245. Maximum Trailing Zeros in a Cornered Path
- 2237. Count Positions on Street With Required Brightness
- 2234. Maximum Total Beauty of the Gardens
- 2222. Number of Ways to Select Buildings
- 2219. Maximum Sum Score of Array
- 2218. Maximum Value of K Coins From Piles
- 2209. Minimum White Tiles After Covering With Carpets
- 2207. Maximize Number of Subsequences in a String
- 2171. Removing Minimum Number of Magic Beans
- 2145. Count the Hidden Sequences
- 2132. Stamping the Grid
- 2121. Intervals Between Identical Elements
- 2106. Maximum Fruits Harvested After at Most K Steps
- 2100. Find Good Days to Rob the Bank
- 2083. Substrings That Begin and End With the Same Letter
- 2055. Plates Between Candles
- 2025. Maximum Number of Ways to Partition an Array
- 2024. Maximize the Confusion of an Exam
- 2021. Brightest Position on Street
- 2017. Grid Game
- 1991. Find the Middle Index in Array
- 1983. Widest Pair of Indices With Equal Range Sum
- 1943. Describe the Painting
- 1930. Unique Length-3 Palindromic Subsequences
- 1915. Number of Wonderful Substrings
- 1895. Largest Magic Square
- 1894. Find the Student that Will Replace the Chalk
- 1893. Check if All the Integers in a Range Are Covered
- 1889. Minimum Space Wasted From Packaging
- 1878. Get Biggest Three Rhombus Sums in a Grid
- 1872. Stone Game VIII
- 1871. Jump Game VII
- 1862. Sum of Floored Pairs
- 1856. Maximum Subarray Min-Product
- 1854. Maximum Population Year
- 1838. Frequency of the Most Frequent Element
- 1829. Maximum XOR for Each Query
- 1788. Maximize the Beauty of the Garden
- 1769. Minimum Number of Operations to Move All Balls to Each Box
- 1744. Can You Eat Your Favorite Candy on Your Favorite Day?
- 1738. Find Kth Largest XOR Coordinate Value
- 1737. Change Minimum Characters to Satisfy One of Three Conditions
- 1732. Find the Highest Altitude
- 1712. Ways to Split Array Into Three Subarrays
- 1703. Minimum Adjacent Swaps for K Consecutive Ones
- 1687. Delivering Boxes from Storage to Ports
- 1685. Sum of Absolute Differences in a Sorted Array
- 1674. Minimum Moves to Make Array Complementary
- 1664. Ways to Make a Fair Array
- 1658. Minimum Operations to Reduce X to Zero
- 1590. Make Sum Divisible by P
- 1589. Maximum Sum Obtained of Any Permutation
- 1588. Sum of All Odd Length Subarrays
- 1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
- 1524. Number of Sub-arrays With Odd Sum
- 1508. Range Sum of Sorted Subarray Sums
- 1480. Running Sum of 1d Array
- 1444. Number of Ways of Cutting a Pizza
- 1442. Count Triplets That Can Form Two Arrays of Equal XOR
- 1423. Maximum Points You Can Obtain from Cards
- 1422. Maximum Score After Splitting a String
- 1420. Build Array Where You Can Find The Maximum Exactly K Comparisons
- 1413. Minimum Value to Get Positive Step by Step Sum
- 1371. Find the Longest Substring Containing Vowels in Even Counts
- 1352. Product of the Last K Numbers
- 1314. Matrix Block Sum
- 1310. XOR Queries of a Subarray
- 1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
- 1248. Count Number of Nice Subarrays
- 1208. Get Equal Substrings Within Budget
- 1177. Can Make Palindrome from Substring
- 1140. Stone Game II
- 1124. Longest Well-Performing Interval
- 1109. Corporate Flight Bookings
- 1094. Car Pooling
- 1074. Number of Submatrices That Sum to Target
- 1004. Max Consecutive Ones III
- 1000. Minimum Cost to Merge Stones
- 995. Minimum Number of K Consecutive Bit Flips
- 974. Subarray Sums Divisible by K
- 930. Binary Subarrays With Sum
- 903. Valid Permutations for DI Sequence
- 862. Shortest Subarray with Sum at Least K
- 848. Shifting Letters
- 813. Largest Sum of Averages
- 798. Smallest Rotation with Highest Score
- 732. My Calendar III
- 731. My Calendar II
- 724. Find Pivot Index
- 713. Subarray Product Less Than K
- 689. Maximum Sum of 3 Non-Overlapping Subarrays
- 644. Maximum Average Subarray II
- 560. Subarray Sum Equals K
- 548. Split Array with Equal Sum
- 525. Contiguous Array
- 523. Continuous Subarray Sum
- 497. Random Point in Non-overlapping Rectangles
- 410. Split Array Largest Sum
- 370. Range Addition
- 363. Max Sum of Rectangle No Larger Than K
- 325. Maximum Size Subarray Sum Equals k
- 304. Range Sum Query 2D - Immutable
- 303. Range Sum Query - Immutable
- 253. Meeting Rooms II
- 238. Product of Array Except Self
- 209. Minimum Size Subarray Sum
Recursion¶
- 3483. Unique 3-Digit Even Numbers
- 3307. Find the K-th Character in String Game II
- 3304. Find the K-th Character in String Game I
- 2550. Count Collisions of Monkeys on a Polygon
- 2487. Remove Nodes From Linked List
- 1969. Minimum Non-Zero Product of the Array Elements
- 1922. Count Good Numbers
- 1823. Find the Winner of the Circular Game
- 1808. Maximize Number of Nice Divisors
- 1545. Find Kth Bit in Nth Binary String
- 1265. Print Immutable Linked List in Reverse
- 1106. Parsing A Boolean Expression
- 894. All Possible Full Binary Trees
- 779. K-th Symbol in Grammar
- 776. Split BST
- 772. Basic Calculator III
- 770. Basic Calculator IV
- 761. Special Binary String
- 736. Parse Lisp Expression
- 544. Output Contest Matches
- 509. Fibonacci Number
- 486. Predict the Winner
- 439. Ternary Expression Parser
- 394. Decode String
- 390. Elimination Game
- 342. Power of Four
- 326. Power of Three
- 273. Integer to English Words
- 255. Verify Preorder Sequence in Binary Search Tree
- 248. Strobogrammatic Number III
- 247. Strobogrammatic Number II
- 241. Different Ways to Add Parentheses
- 234. Palindrome Linked List
- 233. Number of Digit One
- 231. Power of Two
- 224. Basic Calculator
- 206. Reverse Linked List
- 203. Remove Linked List Elements
- 143. Reorder List
- 60. Permutation Sequence
- 50. Pow(x, n)
- 44. Wildcard Matching
- 25. Reverse Nodes in k-Group
- 24. Swap Nodes in Pairs
- 21. Merge Two Sorted Lists
- 10. Regular Expression Matching
- 2. Add Two Numbers
Sliding Window¶
- 3505. Minimum Operations to Make Elements Within K Subarrays Equal
- 3445. Maximum Difference Between Even and Odd Frequency II
- 3439. Reschedule Meetings for Maximum Free Time I
- 3422. Minimum Operations to Make Subarray Elements Equal
- 3420. Count Non-Decreasing Subarrays After K Operations
- 3413. Maximum Coins From K Consecutive Bags
- 3411. Maximum Subarray With Equal Products
- 3364. Minimum Positive Sum Subarray
- 3347. Maximum Frequency of an Element After Performing Operations II
- 3346. Maximum Frequency of an Element After Performing Operations I
- 3329. Count Substrings With K-Frequency Characters II
- 3325. Count Substrings With K-Frequency Characters I
- 3323. Minimize Connected Groups by Inserting Interval
- 3321. Find X-Sum of All K-Long Subarrays II
- 3318. Find X-Sum of All K-Long Subarrays I
- 3306. Count of Substrings Containing Every Vowel and K Consonants II
- 3305. Count of Substrings Containing Every Vowel and K Consonants I
- 3298. Count Substrings That Can Be Rearranged to Contain a String II
- 3297. Count Substrings That Can Be Rearranged to Contain a String I
- 3261. Count Substrings That Satisfy K-Constraint II
- 3258. Count Substrings That Satisfy K-Constraint I
- 3255. Find the Power of K-Size Subarrays II
- 3254. Find the Power of K-Size Subarrays I
- 3234. Count the Number of Substrings With Dominant Ones
- 3208. Alternating Groups II
- 3206. Alternating Groups I
- 3191. Minimum Operations to Make Binary Array Elements Equal to One I
- 3135. Equalize Strings by Adding or Removing Characters at Ends
- 3134. Find the Median of the Uniqueness Array
- 3097. Shortest Subarray With OR at Least K II
- 3095. Shortest Subarray With OR at Least K I
- 3090. Maximum Length Substring With Two Occurrences
- 3086. Minimum Moves to Pick K Ones
- 3037. Find Pattern in Infinite Stream II
- 3023. Find Pattern in Infinite Stream I
- 3013. Divide an Array Into Subarrays With Minimum Cost II
- 2982. Find Longest Special Substring That Occurs Thrice II
- 2981. Find Longest Special Substring That Occurs Thrice I
- 2968. Apply Operations to Maximize Frequency Score
- 2962. Count Subarrays Where Max Element Appears at Least K Times
- 2958. Length of Longest Subarray With at Most K Frequency
- 2953. Count Complete Substrings
- 2935. Maximum Strong Pair XOR II
- 2932. Maximum Strong Pair XOR I
- 2904. Shortest and Lexicographically Smallest Beautiful String
- 2902. Count of Sub-Multisets With Bounded Sum
- 2875. Minimum Size Subarray in Infinite Array
- 2841. Maximum Sum of Almost Unique Subarray
- 2831. Find the Longest Equal Subarray
- 2799. Count Complete Subarrays in an Array
- 2781. Length of the Longest Valid Substring
- 2779. Maximum Beauty of an Array After Applying Operation
- 2762. Continuous Subarrays
- 2760. Longest Even Odd Subarray With Threshold
- 2747. Count Zero Request Servers
- 2743. Count Substrings Without Repeating Character
- 2730. Find the Longest Semi-Repetitive Substring
- 2653. Sliding Subarray Beauty
- 2555. Maximize Win From Two Segments
- 2537. Count the Number of Good Subarrays
- 2528. Maximize the Minimum Powered City
- 2524. Maximum Frequency Score of a Subarray
- 2516. Take K of Each Character From Left and Right
- 2461. Maximum Sum of Distinct Subarrays With Length K
- 2444. Count Subarrays With Fixed Bounds
- 2411. Smallest Subarrays With Maximum Bitwise OR
- 2401. Longest Nice Subarray
- 2398. Maximum Number of Robots Within Budget
- 2379. Minimum Recolors to Get K Consecutive Black Blocks
- 2302. Count Subarrays With Score Less Than K
- 2271. Maximum White Tiles Covered by a Carpet
- 2269. Find the K-Beauty of a Number
- 2260. Minimum Consecutive Cards to Pick Up
- 2156. Find Substring With Given Hash Value
- 2134. Minimum Swaps to Group All 1's Together II
- 2107. Number of Unique Flavors After Sharing K Candies
- 2106. Maximum Fruits Harvested After at Most K Steps
- 2090. K Radius Subarray Averages
- 2067. Number of Equal Count Substrings
- 2024. Maximize the Confusion of an Exam
- 2009. Minimum Number of Operations to Make Array Continuous
- 1984. Minimum Difference Between Highest and Lowest of K Scores
- 1918. Kth Smallest Subarray Sum
- 1888. Minimum Number of Flips to Make the Binary String Alternating
- 1876. Substrings of Size Three with Distinct Characters
- 1871. Jump Game VII
- 1852. Distinct Numbers in Each Subarray
- 1839. Longest Substring Of All Vowels in Order
- 1838. Frequency of the Most Frequent Element
- 1763. Longest Nice Substring
- 1703. Minimum Adjacent Swaps for K Consecutive Ones
- 1695. Maximum Erasure Value
- 1658. Minimum Operations to Reduce X to Zero
- 1652. Defuse the Bomb
- 1610. Maximum Number of Visible Points
- 1499. Max Value of Equation
- 1493. Longest Subarray of 1's After Deleting One Element
- 1477. Find Two Non-overlapping Sub-arrays Each With Target Sum
- 1456. Maximum Number of Vowels in a Substring of Given Length
- 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
- 1425. Constrained Subsequence Sum
- 1423. Maximum Points You Can Obtain from Cards
- 1358. Number of Substrings Containing All Three Characters
- 1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
- 1297. Maximum Number of Occurrences of a Substring
- 1248. Count Number of Nice Subarrays
- 1234. Replace the Substring for Balanced String
- 1208. Get Equal Substrings Within Budget
- 1176. Diet Plan Performance
- 1156. Swap For Longest Repeated Character Substring
- 1151. Minimum Swaps to Group All 1's Together
- 1100. Find K-Length Substrings With No Repeated Characters
- 1052. Grumpy Bookstore Owner
- 1044. Longest Duplicate Substring
- 1031. Maximum Sum of Two Non-Overlapping Subarrays
- 1004. Max Consecutive Ones III
- 995. Minimum Number of K Consecutive Bit Flips
- 992. Subarrays with K Different Integers
- 978. Longest Turbulent Subarray
- 930. Binary Subarrays With Sum
- 904. Fruit Into Baskets
- 862. Shortest Subarray with Sum at Least K
- 837. New 21 Game
- 727. Minimum Window Subsequence
- 718. Maximum Length of Repeated Subarray
- 713. Subarray Product Less Than K
- 689. Maximum Sum of 3 Non-Overlapping Subarrays
- 683. K Empty Slots
- 658. Find K Closest Elements
- 643. Maximum Average Subarray I
- 632. Smallest Range Covering Elements from K Lists
- 594. Longest Harmonious Subsequence
- 567. Permutation in String
- 487. Max Consecutive Ones II
- 480. Sliding Window Median
- 438. Find All Anagrams in a String
- 424. Longest Repeating Character Replacement
- 413. Arithmetic Slices
- 395. Longest Substring with At Least K Repeating Characters
- 340. Longest Substring with At Most K Distinct Characters
- 239. Sliding Window Maximum
- 220. Contains Duplicate III
- 219. Contains Duplicate II
- 209. Minimum Size Subarray Sum
- 187. Repeated DNA Sequences
- 159. Longest Substring with At Most Two Distinct Characters
- 76. Minimum Window Substring
- 30. Substring with Concatenation of All Words
- 3. Longest Substring Without Repeating Characters