Problem C
Hangman

Hangman is a (somewhat macabre) word-guessing game that can
be played by two people. Player
-
If the letter occurs one or more times in the word, Player
writes the letter above each corresponding dash. -
If the letter does not occur in the word, Player
adds one component to a drawing of a stick-figure man hanging on a gallows. The drawing (initially empty) has possible components: base, vertical beam, horizontal beam, rope, head, torso, right leg, left leg, right arm, left arm.
If Player
Ned loves playing hangman, especially as
Player
Input
The input consists of two lines representing a single game
of Hangman. The first line contains the word to be guessed, a
non-empty string of uppercase English alphabet letters
(A–Z) of
maximum length
Output
If Ned wins the game by guessing letters in the order given by the permutation (proceeding from left to right), output “WIN”. Otherwise, output “LOSE”.
Sample Input 1 | Sample Output 1 |
---|---|
HANGMAN ABCDEFGHIJKLMNOPQRSTUVWXYZ |
WIN |
Sample Input 2 | Sample Output 2 |
---|---|
BANANA ABCDEFGHIJKLMNOPQRSTUVWXYZ |
LOSE |
Sample Input 3 | Sample Output 3 |
---|---|
RAINBOWS USIANBVLOJRKWXZCTQGHPFMYDE |
WIN |