hackerrank java solutions if else