Simple C++ approach
\n\n\n# Code\n\nclass Solution {\npublic:\n    vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {\n        \n        int
\n\n\n# Code\n```\nclass Solution {\npublic:\n    vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {\n        \n        int n=l.size();\n        vector<bool>ans(n,true);\n        vector<int>temp;\n        temp=nums;\n\n        for(int i=0;i<n;i++){\n            int a=l[i];\n            int b=r[i];\n            sort(temp.begin()+a,temp.begin()+b+1);\n            int q=temp[a+1]-temp[a];\n            for(int j=a;j<b;j++){\n                int yk=temp[j+1]-temp[j];\n                if(yk!=q){\n                    ans[i]=false;\n                }\n            }\n            temp=nums;\n        \n        }\n        return ans;\n    }\n};\n```
['C++']