[Python] simple recursive solution
\n        ## RC ##\n        ## APPROACH : RECURSION ##\n        ## Similar to 297. Serialize and Deserialize Binary Tree ##\n\t\t## TIME COMPLEXITY : O(N) ##\n\
```\n        ## RC ##\n        ## APPROACH : RECURSION ##\n        ## Similar to 297. Serialize and Deserialize Binary Tree ##\n\t\t## TIME COMPLEXITY : O(N) ##\n\t\t## SPACE COMPLEXITY : O(N) ##\n\nclass Codec:\n\n    def serialize(self, root: TreeNode) -> str:\n        """Encodes a tree to a single string.\n        """\n        def dfs(root, string):\n            if root is None:\n                string += \'None,\'\n            else:\n                string += str(root.val) + \',\'\n                string = dfs(root.left, string)\n                string = dfs(root.right, string)\n            return string\n        return dfs(root, \'\')\n\n    def deserialize(self, data: str) -> TreeNode:\n        """Decodes your encoded data to tree.\n        """\n        def dfs(l):\n            if(l[0] == "None"):\n                l.pop(0)\n                return None\n            root = TreeNode( l.pop(0) )\n            root.left = dfs(l)\n            root.right = dfs(l)\n            return root\n        return dfs( data.split(",")[:-1] )\n```
['Python', 'Python3']