Help needed in HCODE02

how one gets the clue of xoring in this problem? I mean how to approach to the solution of this problem?

Refer these two amazing videos
game theory
sprague-grundy theorem

Kudos to JAlgs for making these awesome videos

Thanks a lot…:slightly_smiling_face:
It was super helpfull