Siemens Interview Question

String manipulation problems from the internet