Pregunta de entrevista de Savant Degrees

Algorithm based question is, find the depth of tree