https://www.acmicpc.net/problem/25773
1
2
3
4
5
6
7
|
def sol(s):
answer = ''.join(sorted(s,reverse=True))
return answer
if __name__ == '__main__':
s = input()
print(sol(s))
|
cs |
sorted 함수(with reverse)를 통해 숫자를 큰 순서대로 정렬하고
join 함수로 리스트에서 문자열로 만들어 return합니다.
Sort the numbers descendingly using sorted function with reverse
and Type cast list to string with join function
반응형
'python-algorithm' 카테고리의 다른 글
백준 14912 숫자 빈도수 (0) | 2022.12.10 |
---|---|
백준 15719 중복된 숫자 (0) | 2022.12.08 |
백준 26040 특정 대문자를 소문자로 바꾸기 (0) | 2022.12.07 |
백준 6976 Divisibility by 11 (0) | 2022.12.07 |
백준 5940 Math Practice (0) | 2022.12.07 |
댓글