easy solution :)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}\n * };\n */\nclass Codec {\npublic:\n\n    // Encodes a tree to a single string.\n    string serialize(TreeNode* root) {\n        if(!root) return "null,";\n        return to_string(root->val)+ "," +serialize(root->left)  +serialize(root->right);        \n    }\n\n    int i=0;\n    // Decodes your encoded data to tree.\n    TreeNode* deserialize(string data) {\n          if(i>=data.size())return nullptr;\n\n        string t="";\n        while(data[i]!=\',\') t+=data[i++];\n        i++;\n\n        if(t=="null") return nullptr;\n        TreeNode* root=new TreeNode(stoi(t));\n        root->left=deserialize(data);\n        root->right=deserialize(data);\n        return root;\n    }\n};\n\n// Your Codec object will be instantiated and called as such:\n// Codec* ser = new Codec();\n// Codec* deser = new Codec();\n// string tree = ser->serialize(root);\n// TreeNode* ans = deser->deserialize(tree);\n// return ans;\n```
['C++']