https://leetcode.com/problems/remove-trailing-zeros-from-a-string/description/
1
2
3
|
class Solution:
def removeTrailingZeros(self, num: str) -> str:
return(str(int(num[::-1]))[::-1])
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2595. Number of Even and Odd Bits (0) | 2023.06.27 |
---|---|
leetcode 2716. Minimize String Length (0) | 2023.06.27 |
leetcode 2656. Maximum Sum With Exactly K Elements (0) | 2023.06.26 |
leetcode 35. Search Insert Position (0) | 2023.06.26 |
leetcode 172. Factorial Trailing Zeroes (0) | 2023.06.26 |
댓글