fork download
  1. input = "wwwwaaadexxxxxx"
  2. list = [0] * 26
  3. for i in input:
  4. list[ord(i)-97]+=1
  5. i=0
  6. while i < len(input):
  7. print input[i], list[ord(input[i])-97]
  8. i += list[ord(input[i])-97]
Success #stdin #stdout 0s 23352KB
stdin
Standard input is empty
stdout
w 4
a 3
d 1
e 1
x 6