题目:
题解:
func reverseWords(s string) string {length := len(s)ret := []byte{}for i := 0; i < length; {start := ifor i < length && s[i] != ' ' {i++}for p := start; p < i; p++ {ret = append(ret, s[start + i - 1 - p])}for i < length && s[i] == ' ' {i++ret = append(ret, ' ')}}return string(ret)
}