Pseudo Code bool IsIsogram

There may be errors, but here is my pseudo code.

bool UBullCowCartridge::IsIsogram(FString Word)
{
    //bool Result = false
    //i = 0
    //wchar_t CurrentCharWord, CurrentCharHiddenWord
    //while (i == Word.Len() || result == true) 
    //{
    //CurrentCharWord = Word[i]
    //j = 0
    //while (j == HiddenWord.Len() || Result == true)
    //{
    //CurrentCharHiddenWord = HiddenWord[j]
    //Check for equivalence with characters to the right
    //If CurrentCharWord == CurrentCharHiddenWord -> Result = true
    //j++
    //}
    //i++
    //}
    //return result;
    return true;
}

I found errors in while loops, the correct way would be

    //while (i < Word.Len() || result != true)

I also misunderstood what the function was actually supposed to do. Not to search for repeated letters between two words, but to search for repeated letters in only one word.

1 Like

Good job :+1:

Privacy & Terms