Easy Intutive O(n) solution iterative (PLEASE UPVOTE)
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- 0(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n- O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    bool isValidSerialization(string a) {\n        int i,j,k,c=1,s=0;\n        if(a.size()==0 )\n        return 1;\n\n        if(a[0]==\'#\' and a.size()!=1)\n        return 0;\n\n        for(i=0;i<a.size();i+=1){\n            c-=1;\n            if(c<0)\n            return 0;\n\n            if(a[i]!=\'#\'){\n                c+=2;\n            }\n            \n            \n            i++;\n            while(i<a.size() and a[i]!=\',\'){\n                i++;\n            }\n        }\n        cout<<c;\n\n        if(c==0)return 1;\n\n        return 0;\n        \n    }\n};\n```
['Tree', 'Binary Tree', 'C++']