Grasping `all-the-apples-at-once' › 竞赛问题 Contest problem [jsr-000V]

大多数候选人都无法解决这个面试问题:

输入: "aaaabbbcca"
输出: [("a",4), ("b", 3), ("c", 2), ("a", 1)]

写一个将输入转换为输出的函数

我在视频面试中提出这个问题,给予 25 分钟时间
你会如何解决?
Alexey Grigorev (@Al_Grigor) February 3, 2021 (Twitter)
Most candidates cannot solve this interview problem:

Input: "aaaabbbcca"
Output: [("a",4), ("b", 3), ("c", 2), ("a", 1)]

Write a function that converts the input to the output

I ask it in the screening interview and give it 25 minutes
How would you solve it?

Alexey Grigorev (@Al_Grigor) February 3, 2021 (Twitter)