Skip to Content
LeetCode The Hard Way

0800 - 0899

Solutions categorised by Problem IDs

813 - Largest Sum of AveragesMaximize the sum of group averages by using dynamic programming to choose partition boundaries in the array.814 - Binary Tree PruningRemove subtrees containing no ones by processing children before deciding whether to keep their parent.829 - Consecutive Numbers SumCount the ways to express an integer as a sum of consecutive positive numbers by examining possible sequence lengths.838 - Push DominoesResolve falling dominoes by comparing the opposing forces between successive pushed positions.841 - Keys and RoomsDetermine whether all rooms are reachable by following the keys collected during depth-first search.844 - Backspace String CompareCompare typed strings after simulating backspaces that remove the preceding character.846 - Hand of StraightsDetermine whether a hand forms equal-sized consecutive groups by processing card values in sorted order and tracking counts.847 - Shortest Path Visiting All NodesFind the shortest walk visiting every graph node by tracking both the current vertex and the set of visited vertices.852 - Peak Index in a Mountain ArrayLocate the peak of a mountain array by binary searching the transition from its rising slope to its falling slope.853 - Car FleetCount car fleets by processing cars in road order and comparing the times they need to reach the destination.867 - Transpose MatrixTranspose a matrix by exchanging row and column indices, including when the matrix is rectangular.869 - Reordered Power of 2Check whether an integer's digits can be rearranged into a power of two by comparing sorted digit sequences.875 - Koko Eating BananasFind the slowest banana-eating speed that meets the deadline by binary searching over possible speeds.876 - Middle of the Linked ListFind the middle of a linked list by moving one pointer twice as fast as the other.877 - Stone GameAnalyze optimal play in the stone game using the parity of pile positions or dynamic programming over intervals.881 - Boats to Save PeopleMinimize rescue boats by sorting weights and deciding when the lightest remaining person can ride with the heaviest.896 - Monotonic ArrayDetermine whether an array stays nondecreasing or nonincreasing as you scan its neighboring values.899 - Orderly QueueFind the lexicographically smallest reachable string by distinguishing rotations from the case where arbitrary reordering is possible.