Skip to content

Commit 24895ca

Browse files
authored
Update subtree-removal-game-with-fibonacci-tree.cpp
1 parent 299cb96 commit 24895ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

C++/subtree-removal-game-with-fibonacci-tree.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ class Solution {
66
bool findGameWinner(int n) {
77
// a pattern appears every 6 grundy numbers in binary forms:
88
// 0000, (0000)01, (0000)11, ((0000)^(0000+1))10, (0000)11, (0000)11
9-
// 0000, (0000+1)01, (0000+1)11, (((0000+1))^((0000+1)+1))10, (0000+1)11, (0000+1)11
10-
// 0000, ((0000+1)+1)01, ((0000+1)+1)11, ((((0000+1)+1))^(((0000+1)+1)+1))10, ((0000+1)+1)11, ((0000+1)+1)11
9+
// 0000, (0000+1)01, (0000+1)11, ((0000+1)^((0000+1)+1))10, (0000+1)11, (0000+1)11
10+
// 0000, ((0000+1)+1)01, ((0000+1)+1)11, (((0000+1)+1)^(((0000+1)+1)+1))10, ((0000+1)+1)11, ((0000+1)+1)11
1111
// ...
1212
// 0000, (XXXX)01, (XXXX)11, ((XXXX)^(XXXX+1))10, (XXXX)11, (XXXX)11
13-
// 0000, (XXXX+1)01, (XXXX+1)11, (((XXXX+1))^((XXXX+1)+1))10, (XXXX+1)11, (XXXX+1)11
13+
// 0000, (XXXX+1)01, (XXXX+1)11, ((XXXX+1)^((XXXX+1)+1))10, (XXXX+1)11, (XXXX+1)11
1414
// => grundy[6k+1] = 0
1515
// grundy[6k+2] = 4k+1
1616
// grundy[6k+3] = 4k+3

0 commit comments

Comments
 (0)