B: Hangman

https://open.kattis.com/problems/hangman

  1. First, store the characters of the word to be guessed in a hash set.

  2. 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, print LOSE and exit.

Last updated