Sort Digits Descending
InterviewTime limit2sMemory limit128 MB
Rearrange the digits of a given natural number so they appear in descending order and print the result.
- Level
Easy2 of 10
- Topics
- Sorting, String, Implementation
- Solved
- No attempts yet
Problem
Given a natural number N, rearrange the digits of N in descending order to form a new number.
Input
The first line contains the natural number N. N is at most 1,000,000,000.
Output
Print the number formed by arranging the digits of N in descending order.