Given a non-negative integer (
n), create a function that returns
n in alphabetical order, according to the literal spelling of each digit in
Input: 101 >> one, zero, one >> one, one, zero Output: 110 Input: 31948 >> three, one, nine, four, eight >> eight, four, nine, one, three Output: 84913 Input: 5544 >> five, five, four, four >> five, five, four, four Output: 5544 Input: 1234567890 Output: 8549176320
Note: the operations in the example are illustrative only and do not need to be included in the output. Only the alphabetically-sorted number needs to be returned.
This is code-golf, so the shortest code in bytes wins.
Edit: the input can be taken in any desired format that best suits your language, and the output can be produced similarly by returning from the function or printing. The input will always be a natural number (including 0) and will not contain leading 0's.
Relevant OEIS entry (A057846) found by @DomHastings