We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Refer something as grundy numbers in game theory.
grundy numbers are
1->2
2->1
3->4
4->3
..
..
consider left side as pile size and right as grundy number .Create an array of grundy numbers and perform xor.Then its same as nim.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Zero-Move Nim
You are viewing a single comment's thread. Return to all comments →
Refer something as grundy numbers in game theory. grundy numbers are 1->2 2->1 3->4 4->3 .. .. consider left side as pile size and right as grundy number .Create an array of grundy numbers and perform xor.Then its same as nim.