Hackerrank Solution For Java If Else