Java O(N) | 100% Faster Solution
Complexity\n- Time complexity: O(N)\n\n# Code\n\nclass Solution {\n    public boolean btreeGameWinningMove(TreeNode root, int n, int x) {\n        TreeNode[] re
# Complexity\n- Time complexity: O(N)\n\n# Code\n```\nclass Solution {\n    public boolean btreeGameWinningMove(TreeNode root, int n, int x) {\n        TreeNode[] red = new TreeNode[1];\n        findNode(root, x, red);\n        int[] countLeft = new int[1], countRight = new int[1];\n        countNodes(red[0].left, countLeft);\n        countNodes(red[0].right, countRight);\n\n        int l = countLeft[0], r = countRight[0];\n\n        return l > n - l || r > n - r || l + r + 1 < n - l - r - 1;      \n    }\n\n    private void countNodes(TreeNode node, int[] count) {\n        if (node == null) return;\n        \n        count[0]++;\n        countNodes(node.left, count);\n        countNodes(node.right, count);\n    }\n\n    private void findNode(TreeNode node, int x, TreeNode[] res) {\n        if (node == null) return;\n        \n        if (node.val == x) {\n            res[0] = node;\n            return;\n        }\n        \n        findNode(node.left, x, res);\n        findNode(node.right, x, res);\n    }\n}\n```
['Java']