Hard LeetCode Problems: Page 3 of 4

Problems 401 to 600 of the 661 Hard-rated problems in this library, continuing the list on the Hard hub.

ProblemsPage 3 of 4
Hard problems, page 3
No.Problem
2360Longest Cycle in a Graph
2366Minimum Replacements to Sort the Array
2376Count Special Integers
2382Maximum Segment Sum After Removals
2386Find the K-Sum of an Array
2392Build a Matrix With Conditions
2398Maximum Number of Robots Within Budget
2402Meeting Rooms III
2407Longest Increasing Subsequence II
2412Minimum Money Required Before Transactions
2416Sum of Prefix Scores of Strings
2421Number of Good Paths
2426Number of Pairs Satisfying Inequality
2430Maximum Deletions on a String
2435Paths in Matrix Whose Sum Is Divisible by K
2440Create Components With Same Value
2444Count Subarrays With Fixed Bounds
2448Minimum Cost to Make Array Equal
2449Minimum Number of Operations to Make Arrays Similar
2454Next Greater Element IV
2458Height of Binary Tree After Subtree Removal Queries
2463Minimum Total Distance Traveled
2468Split Message Based on Limit
2472Maximum Number of Non-overlapping Palindrome Substrings
2478Number of Beautiful Partitions
2484Count Palindromic Subsequences
2488Count Subarrays With Median K
2493Divide Nodes Into the Maximum Number of Groups
2499Minimum Total Cost to Make Arrays Unequal
2503Maximum Number of Points From Grid Queries
2508Add Edges to Make Degrees of All Nodes Even
2509Cycle Length Queries in a Tree
2514Count Anagrams
2518Number of Great Partitions
2528Maximize the Minimum Powered City
2532Time to Cross a Bridge
2538Difference Between Maximum and Minimum Price Sum
2543Check if Point Is Reachable
2547Minimum Cost to Split an Array
2551Put Marbles in Bags
2552Count Increasing Quadruplets
2561Rearranging Fruits
2565Subsequence With the Minimum Score
2569Handling Sum Queries After Update
2573Find the String with LCP
2577Minimum Time to Visit a Cell In a Grid
2581Count Number of Possible Root Nodes
2584Split the Array to Make Coprime Products
2585Number of Ways to Earn Points
2589Minimum Time to Complete All Tasks
2603Collect Coins in a Tree
2608Shortest Cycle in a Graph
2612Minimum Reverse Operations
2617Minimum Number of Visited Cells in a Grid
2642Design Graph With Shortest Path Calculator
2646Minimize the Total Price of the Trips
2659Make Array Empty
2663Lexicographically Smallest Beautiful String
2681Power of Heroes
2699Modify Graph Edge Weights
2709Greatest Common Divisor Traversal
2713Maximum Strictly Increasing Cells in a Matrix
2719Count of Integers
2732Find a Good Subset of the Matrix
2736Maximum Sum Queries
2742Painting the Walls
2751Robot Collisions
2763Sum of Imbalance Numbers of All Subarrays
2781Length of the Longest Valid Substring
2790Maximum Number of Groups With Increasing Length
2791Count Paths That Can Form a Palindrome in a Tree
2801Count Stepping Numbers in Range
2809Minimum Time to Make Array Sum At Most x
2813Maximum Elegance of a K-Length Subsequence
2818Apply Operations to Maximize Score
2827Number of Beautiful Integers in the Range
2835Minimum Operations to Form Subsequence With Target Sum
2836Maximize Value of Function in a Ball Passing Game
2842Count K-Subsequences of a String With Maximum Beauty
2846Minimum Edge Weight Equilibrium Queries in a Tree
2851String Transformation
2858Minimum Edge Reversals So Every Node Is Reachable
2862Maximum Element-Sum of a Complete Subset of Indices
2867Count Valid Paths in a Tree
2872Maximum Number of K-Divisible Components
2876Count Visited Nodes in a Directed Graph
2897Apply Operations on Array to Maximize Sum of Squares
2902Count of Sub-Multisets With Bounded Sum
2911Minimum Changes to Make K Semi-palindromes
2920Maximum Points After Collecting Coins From All Nodes
2926Maximum Balanced Subsequence Sum
2931Maximum Spending After Buying Items
2935Maximum Strong Pair XOR II
2940Find Building Where Alice and Bob Can Meet
2945Find Maximum Non-decreasing Array Length
2953Count Complete Substrings
2954Count the Number of Infection Sequences
2959Number of Possible Sets of Closing Branches
2963Count the Number of Good Partitions
2968Apply Operations to Maximize Frequency Score
2972Count the Number of Incremovable Subarrays II
2973Find Number of Coins to Place in Tree Nodes
2977Minimum Cost to Convert String II
2983Palindrome Rearrangement Queries
2999Count the Number of Powerful Integers
0158Read N Characters Given read4 II - Call Multiple TimesPremium
0248Strobogrammatic Number IIIPremium
0265Paint House IIPremium
0269Alien DictionaryPremium
0272Closest Binary Search Tree Value IIPremium
0296Best Meeting PointPremium
0302Smallest Rectangle Enclosing Black PixelsPremium
0305Number of Islands IIPremium
0317Shortest Distance from All BuildingsPremium
0358Rearrange String k Distance ApartPremium
0411Minimum Unique Word AbbreviationPremium
0425Word SquaresPremium
0428Serialize and Deserialize N-ary TreePremium
0431Encode N-ary Tree to Binary TreePremium
0465Optimal Account BalancingPremium
0471Encode String with Shortest LengthPremium
0489Robot Room CleanerPremium
0499The Maze IIIPremium
0527Word AbbreviationPremium
0548Split Array with Equal SumPremium
0568Maximum Vacation DaysPremium
0569Median Employee SalaryPremium
0571Find Median Given Frequency of NumbersPremium
0579Find Cumulative Salary of an EmployeePremium
0588Design In-Memory File SystemPremium
0615Average Salary: Departments VS CompanyPremium
0618Students Report By GeographyPremium
0631Design Excel Sum FormulaPremium
0642Design Search Autocomplete SystemPremium
0644Maximum Average Subarray IIPremium
0656Coin PathPremium
0660Remove 9Premium
0683K Empty SlotsPremium
0711Number of Distinct Islands IIPremium
0716Max StackPremium
0726Number of Atoms
0727Minimum Window SubsequencePremium
0759Employee Free TimePremium
0770Basic Calculator IV
0772Basic Calculator IIIPremium
0774Minimize Max Distance to Gas StationPremium
0843Guess the Word
0972Equal Rational Numbers
1063Number of Valid SubarraysPremium
1067Digit Count in RangePremium
1088Confusing Number IIPremium
1097Game Play Analysis VPremium
1121Divide Array Into Increasing SequencesPremium
1127User Purchase PlatformPremium
1153String Transforms Into Another StringPremium
1159Market Analysis IIPremium
1168Optimize Water Distribution in a VillagePremium
1183Maximum Number of OnesPremium
1194Tournament WinnersPremium
1199Minimum Time to Build BlocksPremium
1216Valid Palindrome IIIPremium
1225Report Contiguous DatesPremium
1231Divide ChocolatePremium
1246Palindrome RemovalPremium
1259Handshakes That Don't CrossPremium
1274Number of Ships in a RectanglePremium
1336Number of Transactions per VisitPremium
1369Get the Second Most Recent ActivityPremium
1384Total Sales Amount by YearPremium
1397Find All Good Strings
1412Find the Quiet Students in All ExamsPremium
1416Restore The Array
1479Sales by Day of the WeekPremium
1516Move Sub-Tree of N-Ary TreePremium
1520Maximum Number of Non-Overlapping Substrings
1548The Most Similar Path in a GraphPremium
1591Strange Printer II
1597Build Binary Expression Tree From Infix ExpressionPremium
1635Hopper Company Queries IPremium
1645Hopper Company Queries IIPremium
1651Hopper Company Queries IIIPremium
1692Count Ways to Distribute CandiesPremium
1714Sum Of Special Evenly-Spaced Elements In ArrayPremium
1724Checking Existence of Edge Length Limited Paths IIPremium
1767Find the Subtasks That Did Not ExecutePremium
1788Maximize the Beauty of the GardenPremium
1842Next Palindrome Using Same DigitsPremium
1892Page Recommendations IIPremium
1896Minimum Cost to Change the Final Value of Expression
1917Leetcodify Friends RecommendationsPremium
1919Leetcodify Similar FriendsPremium
1924Erect the Fence IIPremium
1932Merge BSTs to Create Single BST
1938Maximum Genetic Difference Query
1956Minimum Time For K Virus Variants to SpreadPremium
1972First and Last Call On the Same DayPremium
2004The Number of Seniors and Juniors to Join the CompanyPremium
2005Subtree Removal Game with Fibonacci TreePremium
2010The Number of Seniors and Juniors to Join the Company IIPremium
2030Smallest K-Length Subsequence With Occurrences of a Letter

Problems with a complete Python solution are listed first, then by ascending problem number. Or go by technique instead: all LeetCode patterns.