Guest User

Untitled

a guest
Feb 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. Problem Statement
  2. Alice and Bob play the following game. The game board consists of some cells in a row. Each cell is marked either 'A' or 'B'. At the beginning, there are no coins placed on the board – all the cells are empty. Alice and Bob take alternating turns. Alice plays first. In each turn, the current player chooses some contiguous empty cells and places a coin onto each of the chosen cells. The player must always choose at least one cell. The player must never choose all empty cells. In other words, after each turn there must be at least one empty cell.
  3.  
  4.  
  5.  
  6. The following picture shows two examples of placing coins:
  7.  
  8.  
  9.  
  10.  
  11.  
  12. The game ends when there is only one cell left without a coin. If that cell is marked 'A', Alice wins. Otherwise, Bob wins. You are given a String cells representing the row of cells. Assuming that both players aim to win and play optimally, return a String containing the name of the winner.
Add Comment
Please, Sign In to add comment