Game

Revision en1, by gXa, 2017-06-26 21:14:14
Suppose there are two piles of plates in the table. One has ‘m’ RED plates and other has ‘n’ BLACK plates. In his/her chance, a player can either pick any number of red plates or any number black plates or equal number of red and black plates. A player loses if he cannot make a move in his/her chance. You are playing this game with your friend. Given that you begin the game and both the players play optimally, output ‘L’ if you will lose or ‘W’ if you will win.

Example:

input: m = 1, n = 2

output: L

input: m = 2, n = 2

output: W

Tags #interview, game

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English gXa 2017-06-26 21:14:14 575 Initial revision (published)