A scoreboard's ticker tape displays a single row of characters. An operator wants to reverse the entire row so that the character currently at the front ends up at the back and vice versa, mirroring the whole message. Given the current contents of the tape as a string, output the tape after the reversal.
The only line of input is the string s to reverse.
Print the reverse of s on a single line.
Example 1
Input
hello
Expected
olleh
Explanation
Reading the 5 characters 'h','e','l','l','o' back to front gives 'o','l','l','e','h', so the tape now reads "olleh".
Example 2
Input
Hannah
Expected
hannaH
Explanation
Reading "Hannah" back to front gives 'h','a','n','n','a','H' — the capital H travels from the front of the tape to the back along with the rest of the character, producing "hannaH".
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →