Java Simple and clean code
\nclass Solution {\n    public List<Boolean> checkArithmeticSubarrays(int[] nums, int[] l, int[] r) {\n        List<Boolean> list = new ArrayList<>();\n        
```\nclass Solution {\n    public List<Boolean> checkArithmeticSubarrays(int[] nums, int[] l, int[] r) {\n        List<Boolean> list = new ArrayList<>();\n        for(int i=0;i<l.length;i++){\n            int s = l[i];\n            int e = r[i];\n            int temp[] = Arrays.copyOfRange(nums,s,e+1);\n            \n            if(check(temp)){\n                list.add(true);\n            }\n            else{\n                list.add(false);\n            }\n        }\n        \n        return list;\n    }\n    \n    public boolean check(int[]arr){    \n        Arrays.sort(arr);\n        \n        if(arr.length==0||arr.length==1){\n            return true;\n        }\n        else{\n            int d = arr[1] - arr[0];\n            for(int i=1;i<arr.length;i++){\n                if((arr[i]-arr[i-1])!=d){\n                    return false;\n                }\n            }\n        }\n        return true;\n    }\n}\n```
['Sorting', 'Java']