Goldman Sachs Interview Question

check whether two trees are same