Pergunta de entrevista da empresa J.P. Morgan

The first question was changing a string to all lowercase, the second question was more difficult, unfortunately I do not remember it.