JPMorganChase Interview Question

Manipulate a string using pseudocode