Game!!

Revision en1, by 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!!

Tags #help, #beginner

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Sudhanshu_Kumar 2019-10-27 21:12:58 777 Initial revision (published)