Problem 1145 · Medium

Binary Tree Coloring Game

Node x splits the rest of the tree into three regions; the second player wins by taking the largest one if it holds more than half the nodes.

Open the interactive visualisation