as title
这是之前去面试的考题
想了很久,不过感觉不是最佳解
做个纪录
期待有大神看到可以提供更好的解法XD
func main() {s := "ABCDEFG"t := len(s) - 1tar1 := stringReverseRecursion1(s, t)log.Println(tar1)}func stringReverseRecursion1(temp string, times int) string {if times < 0 {return temp[len(temp)/2:]}temp += string(temp[times])times--return stringReverseRecursion1(temp, times)}