Given an integer array where the absolute difference between any two adjacent elements is at most k, search for the presence of a target element and return its index, or -1 if not found.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.