# Encode and Decode Strings leetcode.com/problems/encode-and-decode-strings/ Either find a delimiter that is not in the char set: ```python def encode(self, strs: List[str]) -> str: return "\0".join(strs) def decode(self, s: str) -> List[str]: return s.split("\0") ``` Or use length prefixes: ```python def encode(self, strs: List[str]) -> str: return "".join(f"{len(s)}:{s}" for s in strs) def decode(self, s: str) -> List[str]: strs = [] i = 0 while i < len(s): j = s.find(':', i) # search start from i i = j + 1 + int(s[i:j]) strs.append(s[j + 1:i]) return strs ```