Pergunta de entrevista da empresa DoorDash

Find the longest leaf to leaf distance in a tree