Sort Numbers in Descending Order

Published by Николай in

Create a function that takes any non-negative number as an argument and return it with its digits in descending order. Descending order is when you sort from highest to lowest.

Examples

SortDescending(123) ➞ 321

SortDescending(2619805) ➞ 9865210

SortDescending(73065) ➞ 76530

Notes

You can expect non-negative numbers for all test cases.

Watch a quick demo on how Edabit works.