Implementation of IsIsogram()

Hey all!

This is my implementation of the IsIsogram() method. As far as I tested it it works just fine. Lets see what the course will tell me. :slight_smile:

bool FBullCowGame::IsIsogram(FString Word) const
{
    if(Word.length() <= 1) return true;
    TMap<char, bool> LetterSeen;
    for(char Letter : Word) {
        Letter = tolower(Letter);
        
        if(LetterSeen[Letter]) {
            return false;
        } else {
            LetterSeen[Letter] = true;
        }
    }
    return true;
}

Kind Regards
Shadowsound

Privacy & Terms