Java solution beats 100% time: Break the problem down into two easier problems
\nclass Solution {\n    int count;\n    public boolean btreeGameWinningMove(TreeNode root, int n, int x) {\n        if (root == null)\n            return false;
```\nclass Solution {\n    int count;\n    public boolean btreeGameWinningMove(TreeNode root, int n, int x) {\n        if (root == null)\n            return false;\n        \n        // find the node with value x\n        TreeNode target = search(root, x);\n        \n        // separate the tree into three parts around the target: left subtrees, right subtrees, and others\n        int left = subtreeCount(target.left);\n        int right = subtreeCount(target.right);\n        int remain = n - left - right - 1;\n        \n        // return true if the count of any two part is greater than the count of the third part\n        return (remain > left + right + 1) || (left > remain + right + 1) || (right > left + remain + 1);\n    }\n    \n    private TreeNode search(TreeNode root, int x) {\n        if (root == null)\n            return null;\n        \n        if (root.val == x)\n            return root;\n        \n        TreeNode left = search(root.left, x);\n        TreeNode right = search(root.right, x);\n        if (left == null && right == null)\n            return null;\n        else if (left != null)\n            return left;\n        return right;\n    }\n    \n    private int subtreeCount(TreeNode root) {\n        if (root == null)\n            return 0;\n        \n        int leftNodes = subtreeCount(root.left);\n        int rightNodes = subtreeCount(root.right);\n        return leftNodes + rightNodes + 1;\n    }\n}\n```
['Recursion', 'Java']