join2 [LeetCode] Plus One 파이썬 (join, list comprehension) class Solution: def plusOne(self, digits: List[int]) -> List[int]: digits = int("".join([str(x) for x in digits]))+1 digits = list(str(digits)) return digits 2021. 3. 30. [LeetCode] Revese Integer 파이썬 (list comprehension, reverse str) 36ms 걸린 내 솔루션 class Solution: def reverse(self, x: int) -> int: sign = "" if x (2**31)-1 or int(answer) int: if x > 0: result = int(str(x)[::-1]) else: result = -int(str(abs(x))[::-1.. 2021. 3. 25. 이전 1 다음