题解 | #扑克牌顺子#
扑克牌顺子
https://www.nowcoder.com/practice/762836f4d43d43ca9deb273b3de8e1f4
class Solution { public: bool IsContinuous( vector<int> numbers ) { sort(numbers.begin(),numbers.end()); int i,x=0; for(i=3;numbers[i]!=0;i--){ if(numbers[i+1]==numbers[i]){ return false; } x+=(numbers[i+1]-numbers[i]-1); } i++; if(i>=x){ return true; } return false; } };