Ancestry interview question

string manipulation