My code with references during the challenge with GetValidWords

This is my code during the challenge time. I know it’s not ok but that occurred me during the challenge. Of course I’m gonna make the corrections.

TArray<FString> UBullCowCartridge::GetValidWords(TArray<FString> WordList) const{
    TArray<FString> ValidWords;
    
    for (FString Words : WordList)
    {
        if (Words.Len() >=4 && Words.Len() <=8 && IsIsogram(Words))
        {
            ValidWords.Emplace(Words);
        }
    }
    const TArray<FString&> RefValidWords = ValidWords;
    //return ValidWords;
    return RefValidWords;
}

About the question if there are other function to change by references I think not
I’d like to read your comments

Privacy & Terms