[LeetCode] 344. Reverse String

Seo Seung Woo·2022년 7월 11일
0
post-thumbnail

344. Reverse String


❔Thinking

  • 요소를 담은 리스트의 순서를 뒤집어야 한다.
  • return 없이 리스트 자체의 순서를 뒤집어야 한다.

💻Solution

class Solution:
    def reverseString(self, s: List[str]) -> None:
        """
        Do not return anything, modify s in-place instead.
        """
        s.reverse()

🗝️keypoint

  • reverse()는 값의 반환 없이 해당 객체의 순서를 뒤집는다.
profile
Code for people

0개의 댓글