Meta interview question

a leetcode question about binary tree.