Revolut Interview Question

LeetCode question with binary trees.