기출 문제 / 삼성 2024 First Half Afternoon Problem 2

Color Tree

The color tree consists of nodes of various colors, where each node has specific attributes: color color and maximum depth maxdepth. This tree is a system capable of dynamically adding nodes and processing commands to change colors.

Initially, no nodes exist.