# 遵循PEP8规范刚好250字符 def g(s): d = "" while len(s) > 0: d += s[0] n = 1 for j in s[1:]: if j == s[0]: n += 1 else: break d += str(n) s = s[n:] return d