a=raw_input()
c=0
l=[]
for i in a:
l.append(i)
l.sort()
for i in range(len(a)):
if l[i]==l[i+1]:
c+=1
else:
print l[i],"Occurs",c+1,"times"
c=0
Input:
gokulkannan
Output:
a Occurs 2 times
g Occurs 1 times
k Occurs 2 times
l Occurs 1 times
n Occurs 3 times
o Occurs 1 times
0 comments:
Post a Comment