C++ Solution
Code\n\nclass Solution {\npublic:\n    vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {\n        vector<bool> ans;\n  
# Code\n```\nclass Solution {\npublic:\n    vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {\n        vector<bool> ans;\n        for(int i=0; i<l.size(); i++) {\n            vector<int> v;\n            for(int j=l[i]; j<=r[i]; j++) {\n                v.push_back(nums[j]);\n            }\n            sort(v.begin(), v.end());\n            int fd = v[1] - v[0];\n            bool fl = true;\n            for(int j=2; j<v.size(); j++) {\n                if(v[j] - v[j-1] != fd) {\n                    fl = false;\n                    break;\n                }\n            }\n            ans.push_back(fl);\n        }\n        return ans;\n    }\n};\n```
['C++']