java solutions for hacker rank problems