题解 | #扑克牌顺子#
扑克牌顺子
https://www.nowcoder.com/practice/762836f4d43d43ca9deb273b3de8e1f4
class Solution { public: bool hash[14] = {0}; bool IsContinuous(vector<int>& numbers) { int x = 0,y = 14; for(auto a : numbers) { if(a) { if(hash[a]) return false;; hash[a] = true; x = max(x,a); y = min(y,a); } } return x-y<=4; } };