Algorithm/LeetCode 문제 풀이

[LeetCode 344. Reverse String Easy] Python 자신감 뿜뿜

공놀이나하여보세 2019. 5. 11. 16:10

쉬운 문제로 자신감 올리기..

 

class Solution:
    def reverseString(self, s: List[str]) -> None:
        """
        Do not return anything, modify s in-place instead.
        """
        length = (int)(len(s) / 2)
        for i in range(length):
            k = len(s) - 1 - i
            temp = s[i]
            s[i] = s[k]
            s[k] = temp
        

댓글수0