Part C requires you to build an encoder and decoder for the non-simple repeat encoding. This means that the encoded strings may contain more than nine repeats, eg. “a11b11”, and that single characters will be encoded without a number, so “hello” encodes to “hel2o”. You can assume that the un-encoded strings are entirely formed from non-numeric characters.
In Part C, you may use the library functions mod, div, length, reverse, head, tail, last, and init without penalty. All other functions should be implemented by you. It is expected (though not required) that you will implement several helper functions to answer these questions.
Question 8. Write a function complex_encode string that returns the non-simple repeat encoding of string.
Question 9. Write a function complex_decode string that takes a non-simple repeated encoded string, and returns the original un-encoded string.