Domanda di colloquio di Savant Degrees

Algorithm based question is, find the depth of tree