Problem 250 · Medium

Count Univalue Subtrees

Count subtrees where all nodes have the same value using DFS.

Open the interactive visualisation