solution for codeeval