题目链接:https://leetcode-cn.com/problems/bu-ke-pai-zhong-de-shun-zi-lcof/
题目如下:
class Solution {
public:
bool isStraight(vector<int>& nums) {
unordered_set<int> uset;
int small=14,big=0;
for(auto e:nums){
if(e==0) continue;
else if(uset.count(e)>0){
return false;
}else{
uset.insert(e);
small=min(small,e);
big=max(big,e);
}
}
return (big-small)<=4;
}
};