Smallest String Starting From Leaf Leetcode Python