Personal solution for problems in codeeval.com