java code for challenges in codeeval.com