Design an algorithm to encode a list of strings into a single string, and decode that single string back into the exact original list of strings.
The input strings may contain any character — including spaces, empty strings, #, digits, newlines, or Unicode — so a naive delimiter split will break. Implement encode and decode and return decode(encode(strs)) from encode_and_decode.
Input / output
strs: string[]string[] — the exact decoded list produced by decode(encode(strs))0 <= strs.length <= 2000 <= strs[i].length <= 200strs[i] may contain any valid UTF-8 / ASCII character, including # and digitsWhy does length-prefixing (<len>#<payload>) beat escaping a delimiter character when strings contain nested escape sequences or binary data?