Cisco Interview Question

String oprations with some cases