[leetcode-344] ReverseString
ยท
๐Ÿข One step
LeetCode-344 ReverseString : ๋ฌธ์ž์—ด ๋ฆฌ์ŠคํŠธ ๋’ค์ง‘๊ธฐ ๋ฆฌํ„ด ์—†์ด ๋ฆฌ์ŠคํŠธ ๋‚ด๋ถ€์˜ ์ฃผ์†Œ ๊ฐ’์ด ๋ณ€ํ•˜๋„๋ก my answer class Solution: def reverseString(self, s: List[str]) -> None: """ Do not return anything, modify s in-place instead. """ for i in range(len(s)): s.append(s.pop(-i-1)) Result : 394 Memory: 18.4mb 1. ํˆฌ ํฌ์ธํŠธ ์Šค์™‘ {code} Result : 205 Memory: 18.5mb
๋‹คํ–ˆ๋‹ค
'ReverseString' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก