BEGINEER FRIENDLY  C++ ✔|| SIMPLEST BRUTEFORCE APPROACH 🙌
Intuition and Approach :\nHii, so here we came again with new daily question of medium level. \nBefore reading this solution i want you to alrady read question 
# Intuition and Approach :\nHii, so here we came again with new daily question of medium level. \nBefore reading this solution i want you to alrady read question 2,3 times.\nso, here they are basically asking us to return a bool vector that tells whether the  subarray is arithmatic or not if rearranged.\n \nwhat is Arithmatic sequence now ?\nIt is an ordered set of numbers that have a common difference between each consecutive term.\n\nso, what they gave us is vectors \'nums\', \'l\' and \'r\' , that consists of indexes .   now what to do with indexes?\nfor a particular index of l and r, we have check between is sequence is arithmatic or not.\n\nindexes for 1st subarray of "nums" will be taken from "l[0]" to "r[0]".so for 1st iteration we will check nums element from l[0] to r[0], then we will run for total number of paris of l and r. that will be size of l or r.\n\nnow lets talk about how we reach to our answer .\n1. we have to make a for loop that run from 0 to size of l or r. as l and r consists of index value of each subarray hence result vector will have same size.\n2. we then create another vector inside that for loop for storing that subarrays. and it will always  create a new  vector for  new subarray.\n3. then after pushing values we can call a function \'isArithmatic\' that will return bool value in order by checking whether a array is arithmatic or not. in function it will first sort that array( as given in question u can arrange in any order) then check by simple method described in code. see there.\n4. then this way we will get our result bool vector .\n\nHope u find it helpful. if you get more better approaches please leave a comment down below , it helps me to learn more from u guys. thanku \u2764\uD83E\uDD1E\n\n# C++ Code :\n```\nclass Solution { \nprivate: \n    bool isArithmetic( vector<int> vec) {\n    sort(vec.begin(),vec.end());\n    if (vec.size() < 2) {\n        return true;\n    }\n\n    int diff = vec[1] - vec[0];\n\n    for (int i = 1; i < vec.size() - 1; i++) {\n        if (vec[i + 1] - vec[i] != diff) {\n            return false; \n        }\n    }\n\n    return true;\n}\n\npublic:\n    vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {\n        int n=l.size();\n        vector<bool>result(n);\n\n        for(int i=0;i<n;i++){\n            vector<int>temp;\n            for(int j=l[i];j<=r[i];j++){\n                temp.push_back(nums[j]);\n            }\n            result[i]=isArithmetic(temp);\n        }\n        return result;\n    }\n};\n```
['Array', 'Sorting', 'C++']