Easy to understand C++ 100% faster and time and space complexity
\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    \n    void findXInTree(TreeNode*& temp, TreeNode* root, int x) {\n        if(root == NULL)\n            return;\n        if(temp)\n            return;\n        if(x == root -> val)\n            temp = root;\n        findXInTree(temp, root -> left, x);\n        findXInTree(temp, root -> right, x);\n    }\n    \n    int count(TreeNode* root) {\n        if(root == NULL)\n            return 0;\n        if(root -> left == NULL && root -> right == NULL)\n            return 1;\n        int left = count(root -> left);\n        int right = count(root -> right);\n        return 1 + left + right;\n    }\n    \n    bool btreeGameWinningMove(TreeNode* root, int n, int x) {\n        TreeNode* temp = NULL;\n        findXInTree(temp, root, x);\n       // cout << temp -> val;\n        int left = count(temp -> left);\n        int right = count(temp -> right);\n       // cout << left << right;\n        int one = max(left, right);\n        if(temp -> val != root -> val)\n            one = max(one, n - left - right - 1);\n        return (one > (n - one));\n    }\n};\n```
[]