Divide Tree Nodes

Asked at Google · Coding & Leetcode-style Questions · Difficulty: Medium

You are given an undirected tree with **N** nodes. Each node of the tree is assigned to a value. You are required to divide the nodes into as little groups as possible, such that no two nodes in the group are adjacent to each other.

Loading the problem…