however, if n=6, you may probably loose when you pick 1 stone and your friend pick 1, you pick 3, then last one will be picked by your friend. In this circumstance, you will not win.
@ChristyTan no,because the problem tell us both you and your frinend have optimal strategies for the game so when the number is 6 you must choose 2 firstly and then no matter what he choose you will win
@ChristyTan if it is 6 we can choose 2
pick 2 and you will definitely win
@ChristyTan Note the condition that "both you and your friend have optimal strategies". So this is actually a game strategy design whether you can GUARANTEE to win the game no matter how you friend makes a move. If you can GUARANTEE, return true; otherwise, return false. So the result is not random.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.