Files
  • main.py
main.py
1
2
3
4
5
6
7
8
import re
result = ''
input = 'asskkkfhhh'

for (full, ch) in re.findall(r'(([a-z])\2*)', input):
    result += ch + str(len(full))
    
print result