Design a pair of functions that send a list of strings over a channel that can only carry one string. Write encode(strs) returning a single string, and decode(str) returning the original list, so that decode(encode(list)) always equals list.
- The strings may contain any characters at all — digits,
#, brackets, spaces - Empty strings are valid list members, and the empty list must round-trip too
- Any single separator character can appear inside the data, so a plain join will not do
- Prefix each string with its length and a delimiter:
5#hello