class Solution {
public:
string bestHand(vector<int>& ranks, vector<char>& suits) {
int sameNum = 0;
if (count(suits.begin(),suits.end(),suits[0]) == 5) return "Flush";
for (int i = 0; i < ranks.size(); i++)
{
int ct = count(ranks.begin(),ranks.end(),ranks[i]);
sameNum = sameNum < ct ? ct : sameNum;
}
switch(sameNum){
case 5:;
case 4:;
case 3: return "Three of a Kind";
case 2: return "Pair";
case 1: return "High Card";
}
return "";
}
};
标签:case,2347,return,sameNum,ranks,手牌,int,suits,LeetCode
From: https://www.cnblogs.com/zjacky/p/17137219.html