# https://leetcode.com/problems/encode-and-decode-strings/


class Codec:

    def encode(self, strs):
        """Encodes a list of strings to a single string.

        :type strs: List[str]
        :rtype: str
        """
        return ''.join(s.replace('|', '||') + ' | ' for s in strs)

    def decode(self, s):
        """Decodes a single string to a list of strings.

        :type s: str
        :rtype: List[str]
        """
        return [x.replace('||', '|') for x in s.split(' | ')[:-1]]

# Your Codec object will be instantiated and called as such:
# codec = Codec()
# codec.decode(codec.encode(strs))

# https://leetcode.com/problems/encode-and-decode-strings/


class Codec:

    def encode(self, strs):
        """Encodes a list of strings to a single string.

        :type strs: List[str]
        :rtype: str
        """
        return ''.join(s.replace('|', '||') + ' | ' for s in strs)

    def decode(self, s):
        """Decodes a single string to a list of strings.

        :type s: str
        :rtype: List[str]
        """
        return [x.replace('||', '|') for x in s.split(' | ')[:-1]]

# Your Codec object will be instantiated and called as such:
# codec = Codec()
# codec.decode(codec.encode(strs))

# https://leetcode.com/problems/encode-and-decode-strings/ Encodes a list of strings to a single string.          :type strs: List[str]         :rtype: str Decodes a single string to a list of strings.          :type s: str         :rtype: List[str] # Your Codec object will be instantiated and called as such: # codec = Codec() # codec.decode(codec.encode(strs))