관리 메뉴

솜씨좋은장씨

[BaekJoon] 25773번 : Number Maximization (Python) 본문

Programming/코딩 1일 1문제

[BaekJoon] 25773번 : Number Maximization (Python)

솜씨좋은장씨 2022. 11. 24. 12:00
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Number Maximization 입니다.

 

25773번: Number Maximization

There is only one input line; it contains an integer between 0 and 999,999 (inclusive). Assume that the input number will not have leading 0’s. Note, however, that the input can be just the value 0.

www.acmicpc.net

🧑🏻‍💻 코드 ( Solution )

def number_maximization(number):
    number_list = list(number)
    
    max_num = sorted(number_list, reverse=True)
    
    return "".join(max_num)


if __name__ == "__main__":
    number = input()
    
    print(number_maximization(number=number))
 

GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07

1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.

github.com

Comments