Question: Haskell: Write a function encode string (using recursion) that encodes string in the simple repeat encoding. So encode aaabbbccc should return a3b3c3 and encode abcd
Haskell:
Write a function encode string (using recursion) that encodes string in the simple repeat encoding.
So encode "aaabbbccc" should return "a3b3c3" and encode "abcd" should return "a1b1c1d1".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
