practice_runLengthEncoding/problem

13 lines
558 B
Text
Raw Permalink Normal View History

2021-02-19 02:07:59 +00:00
programmingpraxis.com February 9, 2021
2021-08-18 10:24:49 +00:00
Alexey Grigorev says:
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 inverview and give it 25 minutes. How would you solve it?
Your task is to write the requested function. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.