package main import ( "fmt" "os" "bufio" ) func reverse(sb []byte, left int, right int) { // 对 sb[left, right] 区间进行反转,左闭右闭区间 for i,j := left,right; i<j; i,j = i+1,j-1 { sb[i], sb[j] = sb[j], sb[i] } } func generateReverseSentence(s string) string { sb := []byte(s)...