c++ BFS
\nint solve(TreeNode*node){\n    if(node==NULL) return 0;\n    int cnt=1;\n    cnt+=solve(node->left);\n    cnt+=solve(node->right);\n    return cnt;\n}\n\nclas
```\nint solve(TreeNode*node){\n    if(node==NULL) return 0;\n    int cnt=1;\n    cnt+=solve(node->left);\n    cnt+=solve(node->right);\n    return cnt;\n}\n\nclass Solution {\npublic:\n    bool btreeGameWinningMove(TreeNode* node, int k, int x) {\n        queue<TreeNode*>q;\n        q.push(node);\n        TreeNode*n;\n        while(!q.empty()){\n            n=q.front();\n            q.pop();\n            if(n->val==x) break;\n            if(n->left) q.push(n->left);\n            if(n->right) q.push(n->right);\n        }\n        int leftcnt=solve(n->left);\n        int rightcnt=solve(n->right);\n        int upcnt=k-(leftcnt+rightcnt+1);\n        if(upcnt > rightcnt+leftcnt+1) return true;\n        if(leftcnt > rightcnt+upcnt+1) return true;\n        if(rightcnt > leftcnt+upcnt+1) return true;\n        return false;\n    }\n};\n```
[]