Question
Is Same Reflection DXC Automata Fix Questions AMCAT
int isSameReflection(char *word1,char *word2)
{
//complete the code
}
-------------------------------------
Solution
int isSameReflection(char *word1,char *word2)
{
int size1=strlen(word1);
int size2=strlen(word2);
if(size1!=size2)
return -1;
char temp[100];
void *ptr;
//strcat(temp,word1);
//strcat(temp,word1);
strcat(temp,word1);
strcat(temp,word1);
ptr=strstr(temp,word2);
if(ptr !=NULL)
return 1;
else
return -1;
}