add a new solution
solved with in-order traversal