Meta Interview Question

String manipulation question Big-O time for it