my topcoder solution