一、leetcode地址
https://leetcode.com/problems/reverse-string/
二、问题描述
三、代码实现
语言:Python3
代码:
class Solution:
def reverseString(self, s: List[str]) -> None:
"""
Do not return anything, modify s in-place instead.
"""
i = 0;j = len(s)-1
while i < j:
s[i],s[j] = s[j],s[i]
i += 1
j -= 1