Hackerrank Java Strings Introduction Solution