same-tree accepted solution