[C++] Solution, 40ms
\nclass Solution {\npublic:\n    bool isAP(vector<int> &v){\n        sort(v.begin(),v.end());\n        int n = v.size();\n        int cd = v[1]-v[0];\n        f
```\nclass Solution {\npublic:\n    bool isAP(vector<int> &v){\n        sort(v.begin(),v.end());\n        int n = v.size();\n        int cd = v[1]-v[0];\n        for(int i=2;i<n;i++){\n            if((v[i]-v[i-1])!=cd){\n                return false;\n            }\n        }\n        return true;\n    }\n    vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {\n        vector<bool> v;\n        int m = l.size();\n        for(int i=0;i<m;i++){\n            vector<int> temp(nums.begin()+l[i],nums.begin()+r[i]+1);\n            v.push_back(isAP(temp));\n        }\n      return v;\n    }\n};\n```
[]