Easy To Understand || Simple 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 ind=0; ind<l.size(); ind++){\n            vector<int> dem;\n            bool flg=1;\n            for (int i=l[ind]; i<=r[ind]; i++){\n                dem.push_back(nums[i]);\n            }\n            sort(dem.begin(),dem.end());\n            for (int i=2; i<dem.size(); i++){\n                if (dem[i]-dem[i-1] != dem[1]-dem[0]){\n                    flg=0; break;\n                }\n            }\n            if (flg)ans.push_back(true);\n            else ans.push_back(false);\n        }\n        return ans;\n    }\n};\n```
['Array', 'Math', 'Sorting', 'C++']