Given an array of integers, for each element, find the greatest element that appeared before it. If no such element exists (i.e., the current element is the maximum seen so far), return -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.