Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
CodingPhone Screen, OnsiteSoftware EngineerReported Nov, 2025High Frequency
Examples
Example 1:
Input: nums = [8, 2, 4, 7], limit = 4
Output: 2
Explanation:
Example 2:
Input: nums = [10, 1, 2, 4, 7, 2], limit = 5
Output: 4
Explanation:
Example 3:
Input: nums = [4, 2, 2, 2, 4, 4, 2, 2], limit = 0
Output: 3
Explanation: