Largest Possible Number With Digits
Coding Problem Keys
Largest Possible Number With Digits
Problem Statement
A number N is passed as the input. The program must print the largest possible number with the digits in the given number N.
Boundary Condition(S)
1 <= N <= 9999999
Input Format
The first line contains the value of N.
Output Format
The first line contains the largest possible number with the digits in N.
Example Input/Output 1
Input
265
Output
652
Example Input/Output 2
Input
9090
Output
9900
Example Input/Output 3
Input
222
Output
222
Note: Max Execution Time Limit: 5000 millisecs
Solution
Programming Language: Python 3 Language
print(*sorted(input().strip())[::-1],sep="")
# Published By PKJCODERS
(Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.)
Comments