// Time :: O(n)
//INPUT : asd adg s
//OUTPUT : a
#include<stdio.h>
#include<string.h>
int main()
{
char S[20];
int i=0,j,A[26]={0},C[2]={0,0};
gets(S);
printf("%s",S);
while(S[i]!='\0')
{
if(S[i++]==' ')
continue ;
j=S[i-1]-'a';
A[j]++;
if(C[1]<A[j])
{
C[0]=j;
C[1]=A[j];
}
}
printf("\nOUTPUT : %c\n",C[0]+'a');
return 0;
}
No comments:
Post a Comment