Longest Continuous Subarray With Absolute Diff Limit

Given an integer array nums and an integer limit, return the length of the longest contiguous subarray in which the absolute difference between any two elements is at most limit (i.e. max - min ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: