Python almost in-place version.

This is purely for the sake of the exercise because MutableString
    is deprecated in Python 3. The proper solution still needs to be in
    C/C++.