Went ahead and completed the IsIsogram function

I went ahead to see if I could complete the function on my own, thanks from some basic Java coding from before I actually completed it.

It will be interesting to compare it to what Michael will do, and I’m pretty sure he has a better way to solving this…
Codes can be solved in many ways, but the hard part is to do it as simple as possible (less code).

bool UBullCowCartridge::IsIsogram(FString Word)
{
    for (size_t i = 0; i < Word.Len(); i++)
    {
        TCHAR x = Word[i];

        for (size_t ii = i + 1; ii < Word.Len(); ii++)
        {
            TCHAR y = Word[ii];

            if (y == x)
            {
                return false;
            }
        }        
    }
    return true;
}

A run through to see if it behaves well.




2 Likes

Great job!!

Privacy & Terms