v1
- 元素折中反转 时间O(n/2) 空间O(1)
class Solution:
def reverseString(self, s: List[str]) -> None:
"""
Do not return anything, modify s in-place instead.
"""
mid = s.__len__() >> 1
for i in range(mid):
s[i], s[(-i)-1] = s[(-i)-1], s[i]