Rotate for Max Number

Published by Mubashir Hassan in

Create a function that takes a number and returns the maximum value by rearranging its digits.

Examples

rotate_max_number(123) ➞ 321

rotate_max_number("001") ➞ 100

rotate_max_number(999) ➞ 999

Notes

The input number can be a digit or a string.

Watch a quick demo on how Edabit works.