Skip to content

Commit d9b24b5

Browse files
authored
Update README_EN.md
1 parent 20cdefc commit d9b24b5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

solution/0800-0899/0846.Hand of Straights/README_EN.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ func isNStraightHand(hand []int, groupSize int) bool {
314314
```ts
315315
function isNStraightHand(hand: number[], groupSize: number): boolean {
316316
const n = hand.length;
317-
if (n % groupSize) return false;
317+
if (n % groupSize) {
318+
return false;
319+
}
318320

319321
const groups: number[][] = Array.from({ length: n / groupSize }, () => []);
320322
hand.sort((a, b) => a - b);
@@ -323,14 +325,18 @@ function isNStraightHand(hand: number[], groupSize: number): boolean {
323325
let isPushed = false;
324326

325327
for (const g of groups) {
326-
if (g.length === groupSize || (g.length && hand[i] - g.at(-1)! !== 1)) continue;
328+
if (g.length === groupSize || (g.length && hand[i] - g.at(-1)! !== 1)) {
329+
continue;
330+
}
327331

328332
g.push(hand[i]);
329333
isPushed = true;
330334
break;
331335
}
332336

333-
if (!isPushed) return false;
337+
if (!isPushed) {
338+
return false;
339+
}
334340
}
335341

336342
return true;

0 commit comments

Comments
 (0)