Given an array of integers, for each element, find the smallest element in the array that is strictly greater than it. If no such element exists, output a default value like -1.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.