Find the next greater element for each element in an array.
Find the maximum element in each sliding window of size k.