From ce2ffd073c20fa72c07df54b4566d285172276c4 Mon Sep 17 00:00:00 2001 From: to_Geek Date: Sun, 12 Nov 2023 23:44:17 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=200344.=E5=8F=8D=E8=BD=AC?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2.md=20with=20python3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...275\254\345\255\227\347\254\246\344\270\262.md" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git "a/problems/0344.\345\217\215\350\275\254\345\255\227\347\254\246\344\270\262.md" "b/problems/0344.\345\217\215\350\275\254\345\255\227\347\254\246\344\270\262.md" index 8a4fed4574..44184c53bc 100644 --- "a/problems/0344.\345\217\215\350\275\254\345\255\227\347\254\246\344\270\262.md" +++ "b/problems/0344.\345\217\215\350\275\254\345\255\227\347\254\246\344\270\262.md" @@ -250,6 +250,20 @@ class Solution: s[:] = [s[i] for i in range(len(s) - 1, -1, -1)] ``` + +(版本七) 使用reverse() + +```python +class Solution: + def reverseString(self, s: List[str]) -> None: + """ + Do not return anything, modify s in-place instead. + """ + # 原地反转,无返回值 + s.reverse() + +``` + ### Go: ```Go