I use Python to solve the problem. But I think the test cases or online judge system has some issue.
Regardless of what my code is, the time limit exceeded error is always get at the test case "aa", "a".
even if I add these codes in the first two lines of my codes, the error is get, too:
if s == "aa" and p == "a": return False
what's the matter?
By the way, my code run correctly on my local machine with either Python 2.7.8 or Python 3.4.1.