Python Concise O(n) Solution (Beats 90%)
There are 3 best choices depending on the node the first player chose:\n1. The node\'s left child.\n2. The node\'s right child.\n3. The node\'s parent.\n\nFor e
There are 3 best choices depending on the node the first player chose:\n1. The node\'s left child.\n2. The node\'s right child.\n3. The node\'s parent.\n\nFor each choice, our best size is the size of that subtree (if it\'s the parent, its the total nodes - nodes rooted at the 1st player\'s node). The other player gets the rest of nodes that you didn\'t choose.\nCompare all 3 choices and choose the one that would take more nodes than the 1st player.\n\n```\n# Definition for a binary tree node.\n# class TreeNode:\n#     def __init__(self, val=0, left=None, right=None):\n#         self.val = val\n#         self.left = left\n#         self.right = right\nclass Solution:\n    def btreeGameWinningMove(self, root: TreeNode, n: int, x: int) -> bool:\n        parentSize = self.getSize(root, x)\n        node = self.getNode(root, x)\n        leftSize = self.getSize(node.left, None)\n        rightSize = self.getSize(node.right, None)\n        \n        win1 = parentSize > leftSize + rightSize + 1\n        win2 = leftSize > parentSize + rightSize + 1\n        win3 = rightSize > leftSize + parentSize + 1\n        \n        return win1 or win2 or win3\n        \n        \n    def getSize(self, node, stopNode):\n        if not node or node.val == stopNode:\n            return 0\n        \n        return 1 + self.getSize(node.left, stopNode) + self.getSize(node.right, stopNode)\n\n    def getNode(self, root, n):\n        if not root:\n            return None\n        if root.val == n:\n            return root\n        \n        return self.getNode(root.left, n) or self.getNode(root.right, n)\n```
[]