JPMorganChase interview question

Manipulate a string using pseudocode