solution of the problem of SameTree