Java String Introduction Hackerrank Solution