← Amazon questions

Search in array where adjacent elements differ by 1

Filed under Amazon

Given an integer array `arr` where the difference between any two adjacent elements is at most 1, find the index of a given target element `x`. If multiple occurrences exist, returning any valid index…

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 Amazon questions

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