Java - Using Priority Queue - Easy to understand
\n\tpublic boolean isValidSeq(int[] nums, int l, int r) {\n        if(r - l < 1) return false;\n\n        PriorityQueue<Integer> heap = new PriorityQueue<>();\n
```\n\tpublic boolean isValidSeq(int[] nums, int l, int r) {\n        if(r - l < 1) return false;\n\n        PriorityQueue<Integer> heap = new PriorityQueue<>();\n        for(int i = l ; i <= r; ++i) {\n            heap.offer(nums[i]);\n        }\n        int a = heap.poll(), prev = heap.poll();\n        int d = prev - a;\n        while(!heap.isEmpty()) {\n            int curr = heap.poll();\n            if(curr - prev != d) return false;\n            prev = curr;\n        }\n        return true;\n    }\n\n    public List<Boolean> checkArithmeticSubarrays(int[] nums, int[] l, int[] r) {\n        if(l == null || l.length == 0) return new ArrayList<>();\n        List<Boolean> o = new ArrayList<>();\n        for(int i = 0; i < l.length; ++i) {\n            o.add(isValidSeq(nums, l[i], r[i]));\n        }\n        return o;\n    }\n```
[]