bool FBullCowGame::IsIsogram(FString Word) const
{
if (Word.length() <= 1) { return true; }
bool result = true;
TMap<char, bool> CharSeen;
for (char Letter : Word) {
Letter = tolower(Letter);
result = CharSeen.count(Letter) ? false : result;
CharSeen[Letter] = true;
}
return result;
}
1 Like
nice use of the ‘?’ operator! Also that’s a pretty cool implementation! It’s short and sweet!