Easy to understand for everyone
Count left and right children\'s nodes of the player 1\'s initial node with value x. Lets call countLeft and countRight.\n1. if  countLeft or countRight are big
Count left and right children\'s nodes of the player 1\'s initial node with value `x`. Lets call `countLeft` and `countRight`.\n1. if  `countLeft` or `countRight` are bigger than `n/2`, player 2 chooses this child of the node and will win.\n2. If `countLeft + countRight + 1` is smaller than `n/2`, player 2 chooses the parent of the node and will win;\n3. otherwise, player 2 has not chance to win.\n\n```\nvar btreeGameWinningMove = function(root, n, x) {\n    \n    let leftCount = 0;\n    let rightCount = 0;\n    \n    function countNodes(t) {\n        if(!t) return 0;\n        let l = countNodes(t.left);\n        let r = countNodes(t.right);\n        if (t.val == x) {\n            leftCount = l;\n            rightCount = r;\n        }\n        return l + r + 1;\n    }\n    \n    countNodes(root); // calculate node count\n    \n    // if player2 chooses player1\'s parent node and payer1 node\'s count is smaller than n/2, playr2 will win\n    if(leftCount+rightCount+1<n/2) return true;\n    \n    // if player2 chooses player1\'s left or right node and its count is bigger than n/2, playr2 will win\n    if(leftCount>n/2 || rightCount>n/2) return true;\n    \n    return false;\n};\n```
[]