Grasping `all-the-apples-at-once' › 解法样本 Sample solutions › Python (Group I) [#284]

[(k, len(list(g))) for k, g in itertools.groupby("aaaabbbcca")]