http://www.topcoder.com/tc?module=St...d2=complexity1