Topcoder undo problem