It failed the game/contest because of the time constraint. My thoughts are that this is a review for speed. Bearing that in mind, I think it is on-topic. Any other thoughts?
I agree that we should not close questions as "Not working code" because of the time constraint. The code itself is working, it is just too slow. (The same goes for some PHP questions since PHP has a built-in default limit of 30 seconds for script execution)
I, however, voted to close as "Unclear what you are asking" because the six tests are not included in the code, therefore it's not possible for us to see the problem that easily.
I agree that we should not close the question (and when it came up in my review queue, I voted Keep Open....).
Also, I think it is very clear what is being asked (once you get around the long-winded description) -- putting words in the asker's mouth he's saying:
My code works, but it's slow. Any suggestions?