Yandex interview question

Find leaf sum in bin tree