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 <= limit.
- Checking every pair is unnecessary: the condition is equivalent to
max(window) - min(window) <= limit - An empty array yields
0; a single element always qualifies - Target complexity: O(n). A sorted structure or repeated re-scanning of the window gives O(n log n) or O(n^2) — the intended answer keeps both the running max and the running min in amortised O(1) per step