Sort In Descending Number

User
Posted by anthonyo
1 year ago in Q/A Section
91 views
2 replies
User
anthonyo
Posted 1 year ago

Instructions: You can solve this in your favorite language:

Task: Make a function that can take any non-negative integer as an argument and return it with its digits in descending order. Essentially, rearrange the digits to create the highest possible number.

**Result Examples:**

```
Input: 42145 Output: 54421
Input: 145263 Output: 654321
Input: 123456789 Output: 987654321
```

Image preview

Replies (1)

Please login to post a reply.

Thread Actions
Related Tags