1
2
3
4
5
6
7
8
9
10
11
12
|
class Solution:
def maximum69Number (self, num: int) -> int:
num=str(num)
tmp=[]
for i in num: tmp.append(i)
for i in range(len(tmp)):
if tmp[i] =='6':
tmp[i]='9';
break
ans=''
for i in tmp: ans+=i
return (int(ans))
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
Leetcode 905. Sort Array By Parity (0) | 2021.07.23 |
---|---|
Leetcode 1827. Minimum Operations to Make the Array Increasing (0) | 2021.07.21 |
백준 2864 5와 6의 차이 (0) | 2021.07.20 |
Leetcode 1859. Sorting the Sentence (0) | 2021.07.16 |
백준 3029 경고 (0) | 2021.07.16 |
댓글