Java Simple BFS
\nclass Solution {\n    int left, right, x;\n    public boolean btreeGameWinningMove(TreeNode root, int n, int x) {\n        this.x = x;\n        dfs(root);    
```\nclass Solution {\n    int left, right, x;\n    public boolean btreeGameWinningMove(TreeNode root, int n, int x) {\n        this.x = x;\n        dfs(root);    \n        return Math.max(Math.max(left, right), n - left - right - 1) > n / 2;\n    }\n    \n    private int dfs(TreeNode node) {\n        if (node == null) return 0;\n        int l = dfs(node.left);\n        int r = dfs(node.right);\n        if (node.val == x) {\n            left = l;\n            right = r;\n        }\n        return l + r + 1;\n    }\n}\n```\nRef: https://leetcode.com/problems/binary-tree-coloring-game/discuss/350570/JavaC%2B%2BPython-Simple-recursion-and-Follow-Up\n
[]