<filename>Algo and DSA/LeetCode-Solutions-master/Python/reverse-string.py
# Time:  O(n)
# Space: O(1)

class Solution(object):
    def reverseString(self, s):
        """
        :type s: List[str]
        :rtype: None Do not return anything, modify s in-place instead.
        """
        i, j = 0, len(s) - 1
        while i < j:
            s[i], s[j] = s[j], s[i]
            i += 1
            j -= 1

<filename>Algo and DSA/LeetCode-Solutions-master/Python/reverse-string.py
# Time:  O(n)
# Space: O(1)

class Solution(object):
    def reverseString(self, s):
        """
        :type s: List[str]
        :rtype: None Do not return anything, modify s in-place instead.
        """
        i, j = 0, len(s) - 1
        while i < j:
            s[i], s[j] = s[j], s[i]
            i += 1
            j -= 1

# Time:  O(n) # Space: O(1) :type s: List[str]         :rtype: None Do not return anything, modify s in-place instead.