Code:
t=int(input());
i=0;
while(i<t):
a=input();
character='';
count=0;
output=a[0];
max=a.count(output);
for ig in a:
c=a.count(ig);
if(c>max):
max=c;
output=ig;
elif(c==max and output>ig):
output=ig;
print(output);
i=i+1;
Python for beginners: https://www.youtube.com/watch?v=egq7Z...
Join us : t.me/clcoding_python
t=int(input());
i=0;
while(i<t):
a=input();
character='';
count=0;
output=a[0];
max=a.count(output);
for ig in a:
c=a.count(ig);
if(c>max):
max=c;
output=ig;
elif(c==max and output>ig):
output=ig;
print(output);
i=i+1;
Python for beginners: https://www.youtube.com/watch?v=egq7Z...
Join us : t.me/clcoding_python
0 Comments:
Post a Comment