loading...

re: Daily Challenge #245 - Sort Santa's Reindeer VIEW POST

FULL DISCUSSION
 

Elm

reverseWords : String -> String
reverseWords text =
    text
        |> String.words
        |> List.reverse
        |> String.join " "


sortReindeers : List String -> List String
sortReindeers reindeers =
    List.sortBy reverseWords reindeers
code of conduct - report abuse