Google interview question

Find some metric in an arbitrary tree