Is there any other efficient manner of checking duplicate characters from string2 in string1
Code:
char st1[6]="mikem";
char st2[5]="Tame";
int l1=strlen(st1);
int l2=strlen(st2);
int i,j;
for( i=0;i<strlen(st2);i++)
{
for( j=0;j<l1;j++)
{ if(st1[j]=='\0')
continue;
if(st2[i]==st1[j])
{
st1[j]='\0';
}
}
}
The above is checking each and every alphabet from st2 and replacing it with null in st1 ,if match is found
Is ther Any other more efficient way , rather than this one
-thank you