#include <leetcode.h>
◆ isNStraightHand()
bool leetcode::hand_of_straights::Solution::isNStraightHand |
( |
vector< int > & |
hand, |
|
|
int |
groupSize |
|
) |
| |
|
static |
在文件 leetcode.cpp 第 192 行定义.
193 if(hand.size() % groupSize != 0) {
199 sort(hand.begin(), hand.end());
200 const auto len = hand.size() / groupSize;
201 for(
int i = 0; i < len; i++) {
202 int current = *hand.begin();
203 hand.erase(hand.begin());
204 for(
int j = 1; j < groupSize; j++) {
205 auto next =
find(hand.begin(), hand.end(), current + 1);
206 if(next == hand.end()) {
bool find(vector< unordered_set< int > > &g, int x, vector< bool > &st, vector< int > &match)
引用了 acwing::acwing861::find().
被这些函数引用 leetcode::hand_of_straights::TEST().
该类的文档由以下文件生成: