Question
The Eclipse Mirror Protocol
A cryptographer uses a mirror code machine that reverses a message to produce its encrypted form. Given a message as a sequence of characters, reverse the sequence in-place using O(1) extra memory — no copying the message into a new array.
Input
The first line contains KaTeX can only parse string typed expression — the number of characters. The second line contains KaTeX can only parse string typed expression space-separated characters.
Output
KaTeX can only parse string typed expression space-separated characters — the reversed sequence.
Example
Example 1:
Input
Example 2:
Input
Input
5
h e l l oOutputo l l e hExample 2:
Input
4
H a n nOutputn n a H