IsIsogram() solution

My first time posting here. This is my solution :slight_smile:

bool FBullCowGame::IsIsogram(FString Word) const
{
if (Word.length() <= 1) { return true; } //treat 0 and 1 letter words as isograms

TMap<char, bool> LetterSeen; // setup our map
for (auto Letter : Word)      // loop through all the letters of the word
{
	Letter = tolower(Letter); // handle mixed case

	if (LetterSeen[Letter])	// if the letter is in the map
	{
	return false; // we do not have an isogram
	}

	else // otherwise
	{
		LetterSeen[Letter] = true; //add the letter to the map as seen
	}
}
return true; // IsIsogram

}

Privacy & Terms