Dada uma lista de dois ou mais números de série detalhados de igual comprimento maior que dois, por exemplo,
[[ "three" , "one" , "four" ],
[ "one" , "five" , "nine" ],
[ "two" , "six" , "five" ],
[ "three" , "five" , "eight" ]]
classifique a lista pelos números que as palavras representam:
[[ "one" , "five" , "nine" ],
[ "two" , "six" , "five" ],
[ "three" , "one" , "four" ],
[ "three" , "five" , "eight" ]]
Você pode exigir que os números sejam escritos em letras maiúsculas ou minúsculas, mas não mistos.
Casos de teste
[["three","one","four"],["one","five","nine"],["two","six","five"],["three","five","eight"]]
dá[["one","five","nine"],["two","six","five"],["three","one","four"],["three","five","eight"]]
[["two","seven"],["one","eight"],["two","eight"],["one","eight"],["two","eight"],["four","five"]]
dá[["one","eight"],["one","eight"],["two","seven"],["two","eight"],["two","eight"],["four","five"]]
[["one","four","one","four","two"],["one","three","five","six","two"],["three","seven","three","zero","nine"]]
dá[["one","three","five","six","two"],["one","four","one","four","two"],["three","seven","three","zero","nine"]]
[["zero","six","one"],["eight","zero","three"],["three","nine","eight"],["eight","seven","four"],["nine","eight","nine"],["four","eight","four"]]
dá[["zero","six","one"],["three","nine","eight"],["four","eight","four"],["eight","zero","three"],["eight","seven","four"],["nine","eight","nine"]]
[314,159,265,358]
→ [159,265,314,358]
.
You may require the numbers to be spelled in lower or upper, but not mixed, case.
["three","one","four"] === 314
?