Check Arithmetic Sequences, the Jedi Way
IntuitionHmm... Determine if subarrays can form arithmetic sequences, we must. Like testing younglings' lightsaber forms, each sequence must maintain perfect sp
# Intuition
Hmm... Determine if subarrays can form arithmetic sequences, we must. Like testing younglings' lightsaber forms, each sequence must maintain perfect spacing between elements.

# Approach
1. Process each query: For each range [l[i], r[i]], extract the subarray
2. Check sequence validity:
    - Sort the subarray
    - Calculate the common difference
    - Verify all consecutive elements maintain this difference
3. Record results: Store whether each subarray meets the arithmetic condition

# Complexity
- Time complexity: $$O(m*nlogn)$$

- Space complexity: $$O(n)$$

# Code
```cpp []
class Solution {
public:
    vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {
        vector<bool>ans;
        for (int i=0;i<l.size();i++){
            vector<int>c;
            for (int j=l[i];j<=r[i];j++){c.push_back(nums[j]);}
            if (c.size()>1){
                sort(c.begin(),c.end());
                int d=c[1]-c[0];
                bool isok=true;
                for (int j=1;j<c.size();j++){
                    if (c[j]-c[j-1]!=d){isok=false;}
                }
                ans.push_back(isok);
            }
            else {ans.push_back(false);}
        }
        return ans;
    }
};
```
['C++']