Python/leetCode
leetCode - Reverse String 문자열 뒤집기
Example 1 Input: s = ["h","e","l","l","o"] Output: ["o","l","l","e","h"] Example 2 Input: s = ["H","a","n","n","a","h"] Output: ["h","a","n","n","a","H"] reverse 함수 사용 # reverse 함수 사용 class Solution: def reverseString(self, s: List[str]) -> None: """ Do not return anything, modify s in-place instead. """ s.reverse() two point 활용 # two point 사용 class Solution: def reverseString(self, s: List[str]..
2021. 11. 26. 00:09
최근댓글