Compare numeric words

/*

  • Problem 4:

Implement a function sort_numerically() that will receive a list of numbers represented in English words
and return the listed sorted by their numeric value, starting with the largest.

Input:

[
"seventy five",
"two hundred forty one",
"three thousand",
"one million thirty five thousand twelve",
"twenty",
"five hundred thousand",
"two hundred",
]

Output:

[
"one million thirty five thousand twelve",
"five hundred thousand"
"three thousand",
"two hundred forty one",
"two hundred",
"seventy five",
"twenty",
]
*/

Comments (6)