mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 12:15:58 +08:00
@ -157,7 +157,18 @@ class Solution {
|
|||||||
```
|
```
|
||||||
|
|
||||||
Python:
|
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:
|
||||||
```Go
|
```Go
|
||||||
|
Reference in New Issue
Block a user