[关闭]
@aloyschen 2017-09-30T09:01:54.000000Z 字数 368 阅读 99

CodeWars 刷题总结

CodeWars


Reverse words

Write a reverseWords function that accepts a string a parameter, and reverses each word in the string. Every space should stay, so you cannot use words from Prelude.

Example:

reverse_words("This is an example!") # returns "sihT si na !elpmaxe"
reverseWords "An example!" -- "nA !elpmaxe"
reverseWords "double spaces" -- "elbuod secaps"

知识点

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注