Algorithm problem solving for fun on codeeval.com