SORTING TO CHECK || JAVA CODE
\nclass Solution {\n    public List<Boolean> checkArithmeticSubarrays(int[] nums, int[] l, int[] r) {\n        List<Boolean> list=new ArrayList<>(); // boolean 
```\nclass Solution {\n    public List<Boolean> checkArithmeticSubarrays(int[] nums, int[] l, int[] r) {\n        List<Boolean> list=new ArrayList<>(); // boolean list\n        \n        int i=0,  lsize=l.length;  // size of queries \n        while(i<lsize){\n            List<Integer> temp=new ArrayList<>(); // temp list for l to r values\n            \n            \n            for(int j=l[i];j<=r[i];j++){  // storing values in list\n                 temp.add(nums[j]);\n            }\n            \n            \n            Collections.sort(temp); // sort list\n            \n            \n            int diff=temp.get(1)-temp.get(0); // initial diff\n            \n            \n            int check=1;  // maintaing a check for add boolean later\n            \n            \n            for(int j=0;j<temp.size()-1;j++){\n            \n                if(temp.get(j+1)-temp.get(j)!=diff){\n                    check=0;                                // check is off if not arithmetic\n                }\n                \n            }\n            \n            if(check==1){        //check on\n                list.add(true);\n            }else{\n                list.add(false); // else\n            }\n        \n            i++; // next query\n            \n        }\n        return list;\n    }\n}\n```
[]