Don't know what's wrong with my solution, it run just as the condition on my computer, but still cannot pass the test. It seems that some kind of exception occured, but iI cannot figure it out...