We had a programming quiz couple of weeks back at Devpinoy.org.. there where 5 people who dared to take on the quiz but sadly nobody got the correct answer after two rounds of testing(i guess i was pretty strict with my test cases) in the end i decided to just give the prize to the person who got the most correct program(15 out of 17 test cases). All in all it was a fun event...
anyway, i decided to post my answer to the quiz that i gave so that people could see how i solved the quiz(btw, this is not perfectly refactored so don't whine if you see some code smells in it...)