IsIsogram - I got ahead of myself

I’m looking forward to how much simpler I can make this when I’ve actually viewed lecture 65 and above. I used to do a bit of coding back in the day, and I might have jumped the gun a bit! It seems to work, however.

bool UBullCowCartridge::IsIsogram(FString Word)
{
    if (Word.Len() < 1)
    {
        return false;
    }
    if (Word.Len() == 1)
    {
        return true;
    }
    int32 counter = 0;
    int32 newindex = 1;
    while (counter < (Word.Len()))
    {
        int32 index = newindex++;
        while (index < Word.Len())
        {
            if (Word[counter] == Word[index])
            {
                return false;
            }
            ++index;
        }
        ++counter;
    }
    return true;
}
1 Like

Looks great! How much coding did you used to study?

Thanks! I’m a com sci major, then did some web development with PHP and finally some systems programming with C#, but that was 20 years ago! Forgotten a lot, obviously!

Privacy & Terms