CodeEval - Hard Challenge