C++ Easy To Understand Solution | Recursion | Node Count
\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0)
```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0), left(nullptr), right(nullptr) {}\n *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}\n * };\n */\nclass Solution {\npublic:\n    \n    TreeNode* find_node(TreeNode* a,int x)\n    {\n        if(a)\n        {\n            if(a->val==x)\n                return a;\n            TreeNode* h = find_node(a->left,x);\n            if(h)\n                return h;\n            h = find_node(a->right,x);\n            return h;\n        }\n        return a;\n    }\n    \n    int count_node(TreeNode* a)\n    {\n        if(a)\n        {\n            int h = count_node(a->left);\n            int k = count_node(a->right);\n            return h+k+1;\n        }\n        return 0;\n            \n    }\n    \n    bool btreeGameWinningMove(TreeNode* a, int n, int x) {\n        \n        TreeNode *x_node = find_node(a,x);\n        \n        int Left_node = count_node(x_node->left);\n        int Right_node = count_node(x_node->right);\n        int Upper_node = n-Left_node-Right_node-1;\n        \n        int y = max(Upper_node,max(Left_node,Right_node));\n        \n        x = n-y;\n        \n        if(y>x)\n            return 1;\n        return 0;\n        \n        \n    }\n};\n```
['C']