NeetCode #462LC-988MediumTrees
← Back to All Problems

#462 · #988 · Smallest String Starting From Leaf(从叶结点开始的最小字符串)

📌 Problem Statement & Constraints

Given the root of a binary tree where each node holds a value from 0 to 25 (mapping to a-z), each root-to-leaf path forms a string (leaf letter first). Return the lexicographically smallest such string. Constraints: the number of nodes is in [1, 8500], 0 <= Node.val <= 25.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!