A shop sign shows its name one letter at a time. The letters are stored in the array s, one character in each place.
Turn the name around, so that the last letter comes first and the first letter comes last.
Change the array in place, which means inside s itself. Use only O(1) extra memory.
Examples
Example 1:
Input: s = ["k","u","l","f","i"]
Output: ["i","f","l","u","k"]
Explanation: Swap the first and last letters, then the second and second-last. The middle letter l has nothing to swap with.
Example 2:
Input: s = ["O","K"]
Output: ["K","O"]
Explanation: There are only two letters, so they swap places.
Example 3:
Input: s = ["R","A","C","E"]
Output: ["E","C","A","R"]
Explanation: R and E swap, and A and C swap. Upper case letters stay upper case. Only the order changes.