Zillow interview question

convert string to long Trinary Tree