✅✅ [C++] Heavily commented solution
\nclass Solution {\npublic:\n    bool check(vector<int> nums, int i, int j){\n        //arr sorting partially \n        sort(nums.begin() + i, nums.begin() + j 
```\nclass Solution {\npublic:\n    bool check(vector<int> nums, int i, int j){\n        //arr sorting partially \n        sort(nums.begin() + i, nums.begin() + j + 1);\n        // common difference of sorted arithematic subarray\n        int cd = nums[i+1] - nums[i];\n        for(int idx = i; idx < j; idx++){\n            // if common difference is not same then it is not an arithematic subarray hence return false\n            if(nums[idx + 1] - nums[idx] != cd) return false;\n        }\n        return true;\n    }\n    vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {\n        vector<bool> ans;// boolean resultant array in which we store our results\n        int m = l.size();// total number of queries\n        for(int i = 0; i < m; i++){\n            // storing the value if its true or false, sending nums\n            // starting index of subarray and ending index of subarray\n            ans.push_back(check(nums, l[i], r[i]));\n        }\n        return ans;\n    }\n};\n```
['C', 'Sorting']