Welcome!

×

...or use your e-mail

Go back to Challenges list

Challenge

Find the #hashtags

In this challenge you will receive a string with a user comment in your social network and you will need to retrieve the valid #hashtags that the user inserted during the comment.

The rules to detect a valid #hashtags are:

- Hashtags are alphanumeric strings ([a-zA-Z0-9]) prefixed with the hash symbol "#" (e.g. "#keyword" is a valid hashtag and #2Words!? counts as "2Words" only)
- Hashtags cannot be in the middle of a words or characters (e.g. "some#word" and ".?!#word" are invalid)
- Hash symbols ("#") alone are not valid
- If a word is preceded by more than one hash symbol, only one hashtag counts (e.g. "###keyword" counts only as "keyword")
- Since hashtags are only alphanumeric [a-zA-Z0-9] in case (e.g. "###keyword" counts only as "keyword")

Input Format
Each input will be a string

Output Format
The output should be a string with the hashtags in order separated by commas without spaces

Sample Input
Woow awesome #pic dude #lmao #omg

Sample Output
pic,lmao,omg

Memory Limit
512M


Sign Up or Login to solve this Code Challenge