Easy DFS C++ Solution
\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode(int x) : v
```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}\n * };\n */\nclass Solution {\npublic:\n    vector <int> graph[105];\n    set <int> vis;\n    int size = 0;\n    \n    void build(TreeNode *root) {\n        if(!root) return;\n        \n        if(root->left) {\n            graph[root->val].push_back(root->left->val);\n            graph[root->left->val].push_back(root->val);\n        }\n        if(root->right) {\n            graph[root->val].push_back(root->right->val);\n            graph[root->right->val].push_back(root->val);\n        }\n        \n        build(root->left);\n        build(root->right);\n    }\n    \n    void dfs(int node, int x) {\n        vis.insert(node);\n        size += 1;\n        \n        for(int i=0;i<graph[node].size();i++) {\n            if(vis.find(graph[node][i]) == vis.end() && graph[node][i] != x) {\n                dfs(graph[node][i], x);\n            }\n        }    \n    }\n    \n    bool btreeGameWinningMove(TreeNode* root, int n, int x) {\n        build(root);\n        \n        int maxSubtree = -1;\n        for(int i=0;i<graph[x].size();i++) {\n            dfs(graph[x][i], x);\n            maxSubtree = max(maxSubtree, size);\n            size = 0;\n        }\n        \n        return (n - maxSubtree) < maxSubtree;\n    }\n};\n```
['Depth-First Search', 'C']