← OYO questions

Max Absolute Difference Between Nearest Smaller Elements

Filed under OYO

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.

Related OYO questions

Collected from public candidate posts and coding forums. Updated Nov 2026.