J.P. Morgan Interview Question

Was asked a string manipulation question and also a sorting question.