Reverse a string while preserving the positions of spaces.
Implement reverse_string(s), which accepts one string and returns its reversed string. The input and output are both strings, and spaces are treated as ordinary characters that remain present in the reversed result.
def reverse_string(s):