Upside Down

Your printer broke for some reason and prints everything upside down. Your task is to write a program that turns a string upside down, in order for the printer to work properly again.

Example

Input:

let textToPrint = ".nwod edispu ma I"

Expected value/output:

I am upside down.

[collapse]
Hint

Simply reverse the string.

[collapse]
Solution

let textToPrint = ".nwod edispu ma I"
print(String(textToPrint.characters.reversed()))

[collapse]
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...
Subscribe
We send about one email per week with our latest tutorials and updates
Never display this again :)