Finish the method definition given below.
Given a string str
, the method absolute_reverse
should take a string and return the reversed string.
However there are a few rules to follow in order to make the challenge interesting:
- The UPPERCASE/lowercase positions must be kept in the same order as the original string.
- Spaces must be kept in the same order as the original string.
Take a look at the test cases for examples.