IBM interview question

Java string based question