Skip to content

Instantly share code, notes, and snippets.

@clozed2u
Created Sep 22, 2018
Embed
What would you like to do?
func hangman(secretWord string, letters []string) bool {
lettersMap := make(map[string]bool)
for _, v := range letters {
lettersMap[v] = true
}
for _, v := range secretWord {
_, ok := lettersMap[string(v)]
if !ok {
return false
}
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment