B: Hangman
https://open.kattis.com/problems/hangman
First, store the characters of the word to be guessed in a hash set.
Second, iterate through the 26 characters of the guessing order. For each character that appears in the hash set, remove it. If the hash set is empty after removing a character, print
WIN
and exit. If 10 iterations of chars do not appear in the hash set, printLOSE
and exit.
Last updated