Skip to content

Commit 1831aba

Browse files
authored
Update stone-game-ix.py
1 parent 7ad576f commit 1831aba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/stone-game-ix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ def stoneGameIX(self, stones):
1212
"""
1313
count = collections.Counter(x%3 for x in stones)
1414
if count[0]%2 == 0:
15-
# if both counts are not zero, then alice takes the least one at first, the remains are deterministic for bob to lose:
15+
# iff both counts are not zero, then alice takes the least one at first, the remains are deterministic for bob to lose:
1616
# - assumed count[1] is the least one:
1717
# 1(,1,2)*,2,(,2)* => bob loses
1818
# ^
1919
# - assumed count[2] is the least one:
2020
# 2(,2,1)*,1,(,1)* => bob loses
2121
# ^
2222
return count[1] and count[2]
23-
# if abs(count[1] - count[2]) >= 3, then alice takes the most one at first, the remains are deterministic for bob to lose:
23+
# iff abs(count[1] - count[2]) >= 3, then alice takes the most one at first, the remains are deterministic for bob to lose:
2424
# - assumed count[1] is the most one
2525
# 1(,1,2)*,0,1(,2,1)*,1,(,1)* => bob loses
2626
# ^

0 commit comments

Comments
 (0)