I am attempting to reverse a string in-place. For instance "hello world" should result in "olleh dlrow". This example would be no problem, as there is only one space between both words.
But some examples got 3 spaces in a row in the middle of the string, which makes it difficult for me to figure out a good approach as its not enough to use split()
, slicing
& .join()
.