class Solution {
public:
vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {
//比较烂的解法
int len=l.size();
vector<bool>res(len,true);
for(int i=0;i<len;i++)
{
vector<int>temp;
for(int j=l[i];j<=r[i];j++)
{
temp.push_back(nums[j]);
}
sort(temp.begin(),temp.end());
int dis=temp[1]-temp[0];
for(int k=1;k<temp.size()-1;k++)
if(temp[k+1]-temp[k]!=dis)
res[i]=false;
}
return res;
}
};