Explained | C++
Approach\n1. It is always best case for use if either choose y \n\na) left child of x\n\tthis case works when number of nodes in left subtree of x are > n/2\n\n
> Approach\n1. It is always best case for use if either choose y \n\na) left child of x\n\tthis case works when number of nodes in left subtree of x are > n/2\n\nb) right chilf of x\n\tthis case works when number of nodes in right subtree of x are > n/2\n\nc) parent of x\n\tthis case works when number in nodes in tree of x < (n+1)/2\n\t\n2. If we satisfy any of the three condition then we return true\n3. We might not even satisty any of the three condition, then we return false;\n\t\n> Algorithm\n\n```\n\tint go(TreeNode *root) {\n        if(!root) {\n            return 0;\n        }\n        return 1 + go(root->left) + go(root->right);\n    }\n    \n    int l, r;\n    \n    void findNode(TreeNode *root, int x) {\n        if(!root) {\n            return;\n        }\n        if(root->val == x) {\n            l = go(root->left);\n            r = go(root->right);\n            return;\n        }\n        findNode(root->left, x);\n        findNode(root->right, x);\n    }\n    \n    bool btreeGameWinningMove(TreeNode* root, int n, int x) {\n        if(n == 1) {\n            return false;\n        }\n    \n        l = r = 0;\n\t\t\n\t\t// find the root and count the left and right children\n        findNode(root, x);\n        \n\t\t// case 1 and 2 \n        if(l > n/2 || r > n/2) {\n            return true;\n        }\n        \n\t\t// case 3\n        return (l + r + 1) < (n+1)/2;\n    }\n```
[]