This seems to work when I test it. Everything about trying to think this way makes my brain hurt.
bool FBullCowGame::IsIsogram(FString Word) const
{
if (Word.length() <= 1) { return true; }
TMap <char, bool> LetterSeen;
for (auto Letter : Word) //for all letters of the word, colon means in
{
Letter = tolower(Letter); //handles mixed case
LetterSeen[Letter] = true;
if (LetterSeen[Letter])
{
return false;
}
else
{
return true;
}
}
return true;
}
Edit: aaaaand no. no that does not work. lol.