1630 | JavaScript 1-Line Solution
Runtime: 160 ms, faster than 68.07% of JavaScript online submissions\n> Memory Usage: 45 MB, less than 7.56% of JavaScript online submissions\n\njavascript\ncon
> Runtime: **160 ms**, faster than _68.07%_ of JavaScript online submissions\n> Memory Usage: **45 MB**, less than _7.56%_ of JavaScript online submissions\n\n```javascript\nconst checkArithmeticSubarrays = (nums, l, r) =>\n  l.map((start, mapIdx) =>\n    nums\n      .slice(start, r[mapIdx] + 1)\n      .sort((a, b) => a - b)\n      .every((n, everyIdx, arr, diff = arr[1] - arr[0]) =>\n        everyIdx < 2 ? true : n - arr[everyIdx - 1] === diff,\n      ),\n  );\n```
['Sorting', 'JavaScript']