American Express Interview Question

They asked a technical question that involved manipulating a string. They were looking for the most optimal solution.