Created
February 3, 2019 09:02
-
-
Save meidav/de3d3d7d722df2ccae39f9eab281ccfa to your computer and use it in GitHub Desktop.
FBullCowGame::IsIsogram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool FBullCowGame::IsIsogram(FString Word) const | |
{ | |
if (Word.length() <= 1) { return true; } | |
TMap<char, bool> LetterSeen; | |
for (auto Letter : Word) { | |
Letter = tolower(Letter); | |
if (LetterSeen[Letter]) { | |
return false; | |
} else { | |
LetterSeen[Letter] = true; | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment