Given the root of a binary tree where each node has an integer value from 'a' through 'z' (with 'a', 'b', and so on up to 'z'), return the lexicographically smallest string that starts at a leaf node and ends at the root.
A leaf is a node with no children.
Note: If one string is a prefix of another, the shorter string is considered lexicographically smaller (for instance,
"ab"comes before"aba").
Constraints:
The number of nodes in the tree is in the range
Node.val
Given the root of a binary tree where each node has an integer value from 'a' through 'z' (with 'a', 'b', and so on up to 'z'), return the lexicographically smallest string that starts at a leaf node and ends at the root.
A leaf is a node with no children.
Note: If one string is a prefix of another, the shorter string is considered lexicographically smaller (for instance,
"ab"comes before"aba").
Constraints:
The number of nodes in the tree is in the range
Node.val