Meta interview question

Tech screen asked a leetcode hard (Binary tree)