recursive way to solve isSameTree