1
2
3
4
5
|
class Solution:
def largestOddNumber(self, num: str) -> str:
for i in range(len(num)):
if int(num[-1])%2 == 0 : num=num[:-1]
return(num)
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 796. Rotate String (0) | 2022.04.18 |
---|---|
leetcode 202. Happy Number (0) | 2022.04.18 |
leetcode 387. First Unique Character in a String (0) | 2022.04.14 |
leetcode 1317. Convert Integer to the Sum of Two No-Zero Integers (0) | 2022.04.14 |
백준 24079 移動 (Moving) (0) | 2022.04.12 |
댓글