The function takes a string as input and returns the string with its characters rearranged in a specific pattern.

