Two Strings Game Hackerrank Solution Java