Approach for RANDGAME - COOK105A

Can anyone share their approach to the problem RANDGAME please!
I think the official editorials should be published by now.
Thanks!

Person getting 1 can always win the game…
just find out who gets ‘1’ earlier…
suppose number is 101100 in binary then 1st one wins
if number is 1011000 then 2nd one wins…
strategy to win is just keep getting ‘1’ after you get ‘1’ (at LSB side) and also make sure that opponent gets \2 always ( means make a move such that opponent always gets even and you always get an odd number)…
it means for 101100 1st player will do

101100 \2

                10110 \2

1011 -1

                1010 \2

101 +1

                110 \2  

11 -1

                10 \2  

1 -1 win

3 Likes

I have changed the title.
Thanks