344. Reverse String
Last updated
Was this helpful?
Last updated
Was this helpful?
Write a function that reverses a string. The input string is given as an array of characters char[]
.
Do not allocate extra space for another array, you must do this by modifying the input array with O(1) extra memory.
You may assume all the characters consist of .
Example 1:
Example 2: