문제:
nums = list(map(int, input()))
# 삽입 정렬
i = 1
while i < len(nums):
j = i
while 0 < j and nums[j-1] < nums[j]:
nums[j], nums[j-1] = nums[j-1], nums[j]
j -= 1
i += 1
print(''.join(map(str, nums)))
'알고리즘 테스트' 카테고리의 다른 글
[백준 10989번] 수 정렬하기 3 (Python) (0) | 2021.02.17 |
---|---|
[백준 1260번] DFS와 BFS (Python) (0) | 2021.02.06 |
[백준 2751번] 수 정렬하기2 (Python) (0) | 2021.01.19 |
[백준 11047번] 동전 0 (Python) (0) | 2021.01.15 |
[백준] 2798번 블랙잭 (0) | 2021.01.09 |