Each node stores a value in [0..25] mapping to letters 'a'..'z'.
For every leaf→root path, form a string by converting values to letters and reading from the leaf up to the root. Return the lexicographically smallest such string.
Input: root = [0,1,2,3,4,3,4]
Output: "dba"
Input: root = [25,1,3,1,3,0,2]
Output: "adz"
Input: root = [2,2,1,null,1,0,null,0]
Output: "abc"
Accepted:
Submission: