Cruise interview question

build n-ary tree from input strings