Adobe interview question

Tree based easy question from LC