Domanda di colloquio di Amazon

Tree Based Question and One basic Math's.