Given an array, for each element, find the index of the nearest smaller element to the left (L) and right (R). Calculate the absolute difference |L - R| for each element and return the maximum.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.