C++ || Easy || Clean Code || sort
Upvote if you found solution helpful\nC++\nclass Solution\n{\npublic:\n    bool isArithmatic(vector<int> nums, int s, int e)\n    {\n        if (s >= e)\n      
**Upvote if you found solution helpful**\n```C++\nclass Solution\n{\npublic:\n    bool isArithmatic(vector<int> nums, int s, int e)\n    {\n        if (s >= e)\n            return true;\n        vector<int> arr = nums;\n        sort(arr.begin() + s, arr.begin() + e + 1);\n        int diff = arr[s + 1] - arr[s];\n        for (int i = s + 1; i <= e - 1; i++)\n        {\n            if (arr[i + 1] - arr[i] != diff)\n            {\n                return false;\n            }\n        }\n        return true;\n    }\n    vector<bool> checkArithmeticSubarrays(vector<int> &nums, vector<int> &l, vector<int> &r)\n    {\n        vector<bool> ans(l.size(), false);\n        for (int i = 0; i < l.size(); i++)\n        {\n            if (isArithmatic(nums, l[i], r[i]))\n            {\n                ans[i] = true;\n            }\n        }\n        return ans;\n    }\n};\n```
['Array', 'C', 'Sorting']