본문 바로가기
python-algorithm

leetcode 1903. Largest Odd Number in String

by 무적김두칠 2022. 4. 14.

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
반응형

댓글