InterviewDigestInterviewDigest

OA Practice Workspace

Technical2026-08-13

Easy-Medium question 2

AI-Expanded — inferred from the question title, not from the original candidate report

Given an array of integers, find the length of the longest subarray where the absolute difference between any two elements is no greater than one. Return the length of this subarray, ensuring your solution operates in linear time complexity.

Context & Summary

Online coding round with 4 questions of varying difficulty

💻 Coding practice works best on desktop.
Code editors are too cramped on mobile screens.