Run-length encoding
Question
Run-length encoding, is a form of data compression in which a data string of consecutive characters (e.g. "QQQWWWTTTK") are stored as a count and the associated character (e.g. "3Q3W3T1K").
Build a function that can take a single string input and return the run-length encoded equivalent.