[C++] Simple strategy (and some DFS as an afterthought)
The optimal strategy is to make y either the parent of x, or a child. Any other choice is suboptimal, as x could always first grow their territory towards you, 
The optimal strategy is to make `y` either the parent of `x`, or a child. Any other choice is suboptimal, as `x` could always first grow their territory _towards_ you, stealing points that you would otherwise have blocked off.\n\n* If `y` is a child, it gets the number of nodes in that sub-tree, and `x` gets all other nodes.\n* If `y` is the parent, `x` gets the number of nodes in its own sub-tree, and `y` gets all other nodes.\n\nThe code below just tests whether `x` comes out ahead in any of those three scenarios. There are two utility-methods employing DFS to find and count nodes.\n\n```C++\nclass Solution {\npublic:\n  bool btreeGameWinningMove(TreeNode* root, int n, int x) {\n    auto xNode = getNode(root, x);\n    int xLeftCount  = countNodes(xNode->left);\n    int xRightCount = countNodes(xNode->right);\n\tint xCount = 1 + xLeftCount + xRightCount;\n    return xLeftCount  > n/2 ||\n           xRightCount > n/2 ||\n\t\t   xNode != root && xCount <= n/2;\n  }\n  \nprivate:\n  TreeNode* getNode(TreeNode* root, int val) {\n    if (!root) return nullptr;\n    if (root->val == val) return root;\n    auto left = getNode(root->left, val);\n    if (left) return left;\n    return getNode(root->right, val);\n  }\n  \n  int countNodes(TreeNode* root) {\n    if (root) return 1 + countNodes(root->left) + countNodes(root->right);\n    else      return 0;\n  }\n};\n```
['Depth-First Search', 'C']