Solutions to codeeval challenges