String S which is a palindrome is passed as the input. But just one alphabet A is missing in S. The program must print the missing alphabet A.
Note: The FIRST alphabet of S will always be present.
Input Format:
The first line contains S.
Output Format:
The first line contains the missing alphabet A.
Example Input/Output 1:
Input:
malayaam
Output:
l
Solution:
int main()
{
char s[100];
scanf("%s",s);
int l=strlen(s)-1;
for(int i=0;i<strlen(s);i++){
if(s[i]!=s[l]){
printf("%c",s[i]);
break;
}
else{
l--;
}
}
}
Why don't you get adsense still? bro
ReplyDelete