Python with explanation O(N)
You need to make yourself belive that 2nd player will only try to take either left node of x or right node of x or parent node of x:\nif 2nd playes takes left n
You need to make yourself belive that 2nd player will only try to take either left node of x or right node of x or parent node of x:\nif 2nd playes takes left node of x:\n\tthen he can capture all nodes in this subtree. player 1 will capture all nodes nodes except these.\nif 2nd playes takes right node of x:\n\tthen he can capture all nodes in this subtree. player 1 will capture all nodes nodes except these.\nif 2nd playes takes parent node of x:\n\tthen he can capture all nodes except x and its subtrees.\nSo we calculate nodes in left subtree of x, nodes in left subtree of x, node except x and its subtree. \n\n```\nclass Solution:\n    def btreeGameWinningMove(self, root: TreeNode, n: int, x: int) -> bool:\n        def fun(root): #fun counts the node in subtree with root as node\n            if not root:    return 0\n            return 1+fun(root.left)+fun(root.right)\n        arr = [0,0]\n        def f(root):\n            if root:\n                if root.val == x:\n                    arr[0] = fun(root.left)\n                    arr[1] = fun(root.right)\n                    return\n                else:\n                    f(root.left)\n                    f(root.right)\n        f(root)\n        # print(arr)\n        y = max(arr[0], arr[1], n-arr[0]-arr[1]-1)\n        return y > n//2
[]