Skip to Content
LeetCode The Hard Way

1800 - 1899

Solutions categorised by Problem IDs

1800 - Maximum Ascending Subarray SumFind the largest sum of a strictly ascending subarray by extending or restarting the running sum at each element.1822 - Sign of the Product of an ArrayDetermine the sign of an array product by checking for zero and counting the parity of its negative factors.1823 - Find the Winner of the Circular GameFind the survivor of a circular elimination game using a recurrence that maps the winner back to the larger circle.1833 - Maximum Ice Cream BarsBuy the most ice cream bars within budget by counting prices and spending coins on the cheapest bars first.1851 - Minimum Interval to Include Each QueryAnswer each query with the length of its smallest enclosing interval by sorting the queries and tracking candidates in a heap.1854 - Maximum Population YearFind the earliest year with the largest population by sweeping changes at birth and death years.1855 - Maximum Distance Between a Pair of ValuesMaximize the distance between valid indices in two nonincreasing arrays with two pointers or binary search.1859 - Sorting the SentenceReassemble a shuffled sentence by using the position digit attached to each word to recover its original order.1863 - Sum of All Subset XOR TotalsSum XOR values over all subsets by enumerating selections or reasoning about each bit's contribution.1866 - Number of Ways to Rearrange Sticks With K Sticks VisibleCount stick arrangements with exactly k visible sticks by considering where to insert the shortest stick.1899 - Merge Triplets to Form Target TripletDetermine whether triplets can merge into a target by filtering out oversized coordinates and matching each target component.1882 - Process Tasks Using ServersAssign queued tasks to servers by tracking available servers and their release times with two heaps.