class Solution {
public:
bool IsContinuous( vector<int> numbers ) {
sort(numbers.begin(), numbers.end());
int jokerNumber = 0;
int pre = numbers[0];
if(pre == 0)
jokerNumber++;
for(int i = 1; i < numbers.size(); i++) {
int cur = numbers[i];
if(cur == 0)
jokerNumber++;
else {
if(cur == pre)
return false;
}
if(jokerNumber > 4)
return false;
int gap = cur - pre;
while(gap > 1 && jokerNumber && pre > 0) {
jokerNumber--;
gap--;
}
if(pre > 0 && gap > 1)
return false;
pre = cur;
}
return true;
}
};