Program in ide: Input - wwwaabbc
Output - w3a2b2c1
Respuestas de entrevistas
Anónimo
28 feb 2022
Put the char as keys in a map and increase the count if occurring multiple time. Then print the map key and value.
1
Anónimo
5 abr 2022
def reverse(tuples):
k=''
s =[]
for i in tuples:
if i not in s:
if tuples.count(i)>=1:
s.append(i)
s = ''.join(s)
print(s)
for i in s:
m = tuples.count(i)
k+=i+str(m)
return k
print(reverse('wwwaabbc'))