C++ : 0 ms, faster than 100.00% of C++ online submissions for Binary Tree Coloring Game.
\nclass Solution {\npublic:\n    TreeNode *chosen = NULL;\n    \n    bool btreeGameWinningMove(TreeNode* root, int n, int x) {\n        preorder(root , x);\n   
```\nclass Solution {\npublic:\n    TreeNode *chosen = NULL;\n    \n    bool btreeGameWinningMove(TreeNode* root, int n, int x) {\n        preorder(root , x);\n        \n        int leftnodes = countNodes(chosen -> left);\n        int rightnodes = countNodes(chosen -> right);\n        int upNodes = n - (leftnodes + rightnodes) - 1;\n\n        if((leftnodes + rightnodes) < upNodes || (leftnodes + upNodes) < rightnodes || (rightnodes + upNodes) < leftnodes){\n            return true;\n        }\n        \n        return false;\n        \n    }\n    \n    int countNodes(TreeNode *root){\n        if(root == NULL) return 0;\n        \n        return 1 + countNodes(root -> left) + countNodes(root -> right);\n    }\n    \n    void preorder(TreeNode *root , int x){\n        if(root == NULL){\n            return;\n        }\n        \n        if(root -> val == x){\n            chosen = root;\n            return;\n        }\n        preorder(root -> left  , x);\n        preorder(root -> right , x);\n    }\n};\n```
['Depth-First Search', 'C']