My implementation of IsIsogram

bool FBullCowGame::IsIsogram(FString Word) const

{
//treat 0 and 1 letter words as isogram
if (Word.length() <= 1) { return true; }

TMap<char, bool> LetterSeen;//setup a map

for (auto letter : Word) //for each letter in word
{	
	//loop through all the letters in the word
	letter = tolower(letter); //set to lower case

	//find the letter in the map
	//check if it is already set to true
	if (LetterSeen[letter])
	{
		return false; //if it is return false and exit function
	}
	else
	{
		LetterSeen[letter] = true; //if it is not change the map to true and continue checking
	}
		
}
return true;  //fall through for strange entries

}

1 Like

good one!
look pretty much like mine