Problem 988 · Medium

Smallest String Starting From Leaf

Read each leaf-to-root path as letters and keep the smallest string; a shorter prefix sorts first.

Open the interactive visualisation