Skip to content

Commit 007636b

Browse files
authored
Update subtree-removal-game-with-fibonacci-tree.py
1 parent 7efdbf8 commit 007636b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/subtree-removal-game-with-fibonacci-tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ def findGameWinner(self, n):
3434
grundy = [0, 1] # 0-indexed
3535
for i in xrange(2, n):
3636
grundy[i%2] = (grundy[(i-1)%2]+1)^(grundy[(i-2)%2]+1) # colon principle, replace the branches by a non-branching stalk of length equal to their nim sum
37-
return grundy[(n-1)%2]
37+
return grundy[(n-1)%2] > 0

0 commit comments

Comments
 (0)