Golang Leetcode 344. Reverse String.go

版权声明:原创勿转 https://blog.csdn.net/anakinsun/article/details/89068940

思路

暴力破解

code

func reverseString(s []byte) {
	for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
		s[i], s[j] = s[j], s[i]
	}

}

更多内容请移步我的repo:https://github.com/anakin/golang-leetcode

猜你喜欢

转载自blog.csdn.net/anakinsun/article/details/89068940