Can anyone help me with SUPPU AND SAILU from COUT-2k18 ?

Hello friends can someone tell me how to make an approach to this problem ??

@vijju123 @kaushal101 @mohit_negi @taran_1407 @vivek_1998299 @meooow @john_smith_3

Thanks in advance :slight_smile:

See here,the one one who caused 0,1 to occur looses(or the one who as marbles as 0,1 wins)

Now lets us denote shailaja winning as W,losing as L

So if 0 marble - W 1 marble - W

Now we see for 2 marbles i can do only 1 move of 2 which takes me to 0 marbles.Since the other player win,i loose

2 marble - L

For 3 marbles ,by removing 2 or 3 ends me in a state W(for opponent) ie i loose

So just fill the series,if any reachable state from ur state is L(ur oponent looses at that state),then u can do a move going to that state and win,if none is L(u loose)

U could easily see shailaja wins if(n%9==2 or 3)

1 Like

" the one who has marbles as 0,1 wins " cleared it all . Thanks :slight_smile: