Amazon interview question

Reorganize a string into a specific pattern based on prompt.