Juniper Square Interview Question

string manipulation question, quite basic