c++,0ms, modular, beats 100% (both time and memory) with algo and image
The second player will pick y as either left child, right child or parent (depending on which one has max nodes in their vicinity) of the node picked by first p
The second player will pick y as either left child, right child or parent (depending on which one has max nodes in their vicinity) of the node picked by first player.\nIf the no of nodes available for second player is greater than first, he wins \nNote : Equal case will never arise since n is odd\n\nFor example : \n![image](https://assets.leetcode.com/users/goelrishabh5/image_1564894633.png) ![image](https://assets.leetcode.com/users/goelrishabh5/image_1564894011.png) **parent(b:4)** ![image](https://assets.leetcode.com/users/goelrishabh5/image_1564894063.png) **right child (b:3)** ![image](https://assets.leetcode.com/users/goelrishabh5/image_1564894297.png) **left child (b:9)**    \n\nHere, blue wins since it will pick left child. Thus, 9 will be left for blue and for red , 8 will be left\n\n```\nTreeNode* findNode(TreeNode* root,int x)\n    {\n        TreeNode* temp = NULL;\n        if(root)\n        {\n            if(root->val==x)\n                temp = root;\n            else\n            {\n            temp = findNode(root->left,x);\n            if(!temp)\n            temp = findNode(root->right,x);\n            }\n        }\n        return temp;\n    }\n    \n    void countChildren(TreeNode* root, int &no)\n    {\n        if(root)\n        {\n            no++;\n            countChildren(root->left,no);\n            countChildren(root->right,no);    \n        }\n    }\n    \n    bool btreeGameWinningMove(TreeNode* root, int n, int x) {\n        \n        int left=0,right=0,parent=0,blue=0;\n        TreeNode* temp = findNode(root,x); // find node\n        countChildren(temp->left,left);  // count no of nodes in left subtree\n        countChildren(temp->right,right); // count no of nodes in right subtree\n        blue=max(left,right);\n        if(temp->val!=root->val)\n            parent = n-(left+right+1); // count no of nodes apart from given node\'s subtree\n        blue=max(blue,parent);\n        \n        return (blue)>(n-blue);\n    }\n```
['C', 'Binary Tree']