Easy Using a Checking Function
\nclass Solution {\n    public List<Boolean> checkArithmeticSubarrays(int[] nums, int[] l, int[] r) {\n        int i = 0;\n        List<Boolean> ans = new Array
```\nclass Solution {\n    public List<Boolean> checkArithmeticSubarrays(int[] nums, int[] l, int[] r) {\n        int i = 0;\n        List<Boolean> ans = new ArrayList<>();\n        for( ; i<l.length ;i++){\n            ans.add(util(nums,l[i],r[i]));\n        }\n        return ans;\n    }\n     public boolean util(int[] nums, int l, int r) {\n        if(r==l)return true;\n         int arr[] = new int[r-l+1];\n         int j=0;\n         for(int i = l ; i <= r ; i++){\n             arr[j++] = nums[i];\n         }\n         Arrays.sort(arr);\n         int diff = arr[1]-arr[0];\n         for(int i = 1;i<r-l+1;i++){\n             if(arr[i]!=arr[i-1]+diff) return false;\n         }\n         return true;\n    }\n}\n```
['Array', 'Java']