Encode and Decode Strings (LeetCode 271)The problem Design two functions. turns a list of strings into a single string…