其他分享
首页 > 其他分享> > 344. 反转字符串

344. 反转字符串

作者:互联网

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

 

标签:reverseString,None,return,anything,Do,反转,self,344,字符串
来源: https://www.cnblogs.com/bidesen/p/16220241.html