class Solution {
public:
bool IsContinuous( vector<int> numbers ) {
// 不能重复,上下界之差不能超过4
int min = 13, max = 0;
std::unordered_map<int, int> hash;
for (int i = 0; i < numbers.size(); ++i) {
if (numbers[i] != 0) {
if (hash.count(numbers[i])) {
return false;
}
hash[numbers[i]] = i;
if (numbers[i] >= max) {
max = numbers[i];
}
if (numbers[i] <= min) {
min = numbers[i];
}
}
}
return (max - min < 5);
}
};