Solution passed CodeEval