Sollicitatievraag bij Chargebee

Program in ide: Input - wwwaabbc Output - w3a2b2c1

Antwoorden op sollicitatievragen

Anoniem

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

Anoniem

5 apr 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'))