//1.进行排序 2.计算0的个数 3.看是否有对子 4.计算相邻数之间的间隔 class Solution {public:
bool IsContinuous( vector<int> numbers ) {
int num_zero=0;
int num_jiange=0;
int n=numbers.size();
if(n==0)
return false;
int temp;
for(int i=0;i<n;i++){
for(int j=i;j<n;j++){
if(numbers[i]>numbers[j]){
temp=numbers[j];
numbers[j]=numbers[i];
numbers[i]=temp;
}
}
}
for(int i=0;i<n-1;i++){
if(numbers[i]==0){
num_zero++;
continue;
}
if(numbers[i]==numbers[i+1])
return false;
num_jiange+=numbers[i+1]-numbers[i]-1;
}
if(num_zero>=num_jiange)
return true;
return false;
}
};