I checked online the definition of Isogram and it is An
isogram is a word that contains repeated letters the same number of times, thus that presents letters the same number of times.
But the Way Rick Sir is implementing the IsIsogram() It does not match with the definition of isogram
so i have thought of a way to overcome it and here it is (Please correct me if you find anything wrong)
int32 i,j;
TArray<int32> Freq;
//Array Of Frequencies
for(i=0;i<PlayerGuess.Len();i++)
{
TCHAR Letter=PlayerGuess[i];
int32 Frequency=0;
for(j=0;j<PlayerGuess.Len();j++)
{
if(PlayerGuess[j]==Letter)
{
++Frequency;
}
}
Freq.AddUnique(Frequency);
}
//Check For Isogram
for(i=0;i<Freq.Num();i++)
{
for(j=0;j<Freq.Num();j++)
{
if(Freq[i]!=Freq[j])
{
bIsIsogram=false;
break;
}
}
if(!bIsIsogram)
{
PrintLine(TEXT("Entered Word Is Not An Isogram"));
break;
}
}