Given a number, return the maximum value by rearranging it's digits.
Examples:
(123) => 321 (786) => 876 ("001") => 100 (999) => 999 (10543) => 54310
^Note the number may be given as a string
Given a number, return the maximum value by rearranging it's digits.
Examples:
(123) => 321 (786) => 876 ("001") => 100 (999) => 999 (10543) => 54310
^Note the number may be given as a string
Language: Perl 6
Length: 33
Solution:
Demo: