Coding Problems
Maximize profit with 1 day cooldown after sell
Circular Array Loop
MediumDetect if there is a cycle in circular array (forward/backward moves)
Find shortest subarray that if sorted would make entire array sorted
Maximum Gap
HardFind maximum difference between successive elements in sorted form (O(n) time/space)
Minimize largest sum when splitting array into m subarrays
Find Peak Element II
HardFind peak element in 2D array (greater than all neighbors)
Wiggle Sort
MediumReorder array so nums[0] ≤ nums[1] ≥ nums[2] ≤ nums[3]... (in-place)
Continuous Subarray Sum
MediumCheck if array has continuous subarray of size ≥ 2 with sum multiple of k
Subarray Sums Divisible by K
MediumCount subarrays where sum is divisible by k
Find K Closest Elements
MediumFind k closest elements to target in sorted array
Find maximum envelopes you can stack (one inside another)
Find maximum sum subarray in circular array
Count how many elements to the right are smaller than current element
Find largest rectangular area under histogram
Find max in each sliding window of size k (O(n) solution)
Find median of two sorted arrays in O(log(min(m,n))) time
Task Scheduler
MediumFind least number of intervals to complete tasks with cooldown