Write a function that reverses a string. The input string is given as an array of characters s.

You must do this by modifying the input array in-place with O(1) extra memory.

&nbsp;
Example 1:
Input: s = ["h","e","l","l","o"]
Output: ["o","l","l","e","h"]
Example 2:
Input: s = ["H","a","n","n","a","h"]
Output: ["h","a","n","n","a","H"]

&nbsp;
Constraints:


	1 &lt;= s.length &lt;= 105
	s[i] is a printable ascii character.


class Solution(object):
    def reverseString(self, s):
        for i in range(len(s)):
            s.insert(i,s.pop())
        return s
class Solution {
    public void reverseString(char[] s) {
        int start = 0, end = s.length-1;

        while(start < end) {
            char temp = s[end];
            s[end] = s[start];
            s[start] = temp;
            start++;
            end--;
        }

    }
}
class Solution {
public:
    void reverseString(vector<char>& s) {
        int i = -1, j = s.size();
        while (++i < --j){
            //Instead of using temp we can do the following
            s[i] = s[j] + s[i];
            s[j] = s[i] - s[j];
            s[i] = s[i] - s[j];
        }
    }
};
var reverseString = function(s) {
    for(let i = 0 ; i < s.length / 2 ; i++){
        [s[i], s[s.length - i - 1]] = [s[s.length - i - 1], s[i]]
    }
    return s;
};
Reverse String