diff --git a/problems/0344.反转字符串.md b/problems/0344.反转字符串.md index b4c843b7..67d0227e 100644 --- a/problems/0344.反转字符串.md +++ b/problems/0344.反转字符串.md @@ -157,7 +157,18 @@ class Solution { ``` Python: - +```python3 +class Solution: + def reverseString(self, s: List[str]) -> None: + """ + Do not return anything, modify s in-place instead. + """ + left, right = 0, len(s) - 1 + while(left < right): + s[left], s[right] = s[right], s[left] + left += 1 + right -= 1 +``` Go: ```Go