Game!!

Правка en1, от Sudhanshu_Kumar, 2019-10-27 21:12:58

Given an array with n strings and an integer k. White and watson are playing a game. White gets to start game first always. Game follows as: White first picks any string among first k strings.Watson can next pick any string that starts with last character of string picked which from next k strings (next to where white picked). This goes on until a player can choose a string from given k strings. If at any point, a player is unable to choose, he loses. Both the players select strings optimally.If there is a way White can win always, output “Yes” and the string he must choose as first string else output “No” and string watson must choose as first string, that guarantee his win(in this case assume, white selects first string always).

Suggest some approach!!

Теги #help, #beginner

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Sudhanshu_Kumar 2019-10-27 21:12:58 777 Initial revision (published)