class Solution { public: bool IsContinuous( vector<int> numbers ) { unordered_set<int> hashtable; int ma = 0, mi = 14; for (int i = 0; i < 5; ++i) { // 如果是大小王则不作统计 if (numbers[i] == 0) continue; // 不能重复出现 if (hashtable.count(numbers[i])) return false; hashtable.insert(numbers[i]); ma = max(ma, numbers[i]); mi = min(mi, numbers[i]); } // 最后判断最大值与最小值之差是否小于5 return ma - mi < 5; } };