给定一个字符串,找到每个字母开头的第一个单词(不区分大小写)。
样品
使用Ferulas flourish in gorgeous gardens.
的输入:
"Ferulas flourish in gorgeous gardens."
^^^^^^^ ^^ ^^^^^^^^
| | |
| | --> is the first word starting with `g`
| --> is the first word starting with `i`
--> is the first word starting with `f`
然后,此样本的输出应该是匹配的单词,并用一个空格隔开:
"Ferulas in gorgeous"
挑战
输入和输出都必须是字符串表示形式,或者是您语言中最接近的替代形式。
允许的程序或功能。
您可以认为一个单词至少是以下之一:lowercase or uppercase letters, digits, underscore
。
这是代码高尔夫球,最短答案以字节为单位。
另一个样本:
input: "Take all first words for each letter... this is a test"
output: "Take all first words each letter is"
input: "Look ^_^ .... There are 3 little dogs :)"
output: "Look _ There are 3 dogs"
input: "...maybe some day 1 plus 2 plus 20 could result in 3"
output: "maybe some day 1 plus 2 could result in 3"