www.hackerrank.com solutions in java