finished 9.1, but a little different from the solution on book. I dont know why she used <-1 to check the value in array.