[LC] Added solution to isSameTree.