Search
⌘K

Leetcode 988. Smallest String Starting From Leaf

Given a binary tree whose node values 0–25 map to letters 'a'–'z', return the lexicographically smallest string formed by the characters along any path from a leaf up to the root (concatenated leaf→root). The core challenge is comparing these reversed root-to-leaf paths lexicographically to pick the minimum (tree size ≤ 8500).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.