Headline -> Hashtags
Imagine you work for a newspaper and you're job is to automatically post news articles to Twitter. Of course, you need hash tags. Write a function that takes the headline (as a string) and returns a list of hashtags. The hashtags should be the three longest words in the headline, ordered longest to shortest, and of course, with a #
in front. If there are fewer than three words, use as many words as there are. If two words are of the same length, prefer the one that occurs closest to the beginning.
Examples from The Onion, America's finest news source.
(->hashtags "Violently Bored Americans Begin Looting Puzzle Stores")
;; => ("#violently" "#americans" "#looting")
(->hashtags "Trump Quietly Checks With Aides To Make Sure He’d Be Included In Receiving $1,000 Government Checks")
;; => ("#government" "#receiving" "#included")
(->hashtags "Nation Demands More Slow-Motion Footage Of Running Basset Hounds")
;; => ("#demands" "#footage" "#running")
Remember, hashtags are typically all lowercase.
Thanks to this site for the challenge idea.