Meta Interview Question

Tech screen asked a leetcode hard (Binary tree)