Easy understanding java solution || Tree || only traverse
\n# Code\n\nclass Solution {\n    public boolean isValidSerialization(String preorder) {\n        String[]nodes = preorder.split(",");\n\n        int dif=1;\n  
\n# Code\n```\nclass Solution {\n    public boolean isValidSerialization(String preorder) {\n        String[]nodes = preorder.split(",");\n\n        int dif=1;\n        for(String node:nodes){\n         if(--dif<0) return false;\n         if(!node.equals("#")) dif+=2;\n        }\n        return dif==0;\n    }\n}\n``` " UPVOTE IF YOU LIKE THIS SOLUTION!!!"
['Tree', 'Java']