IBM Interview Question

Java string based question