题解 | #反转字符串#
反转字符串
http://www.nowcoder.com/practice/c3a6afee325e472386a1c4eb1ef987f3
package main
/**
* 反转字符串
* @param str string字符串
* @return string字符串
*/
func solve( str string ) string {
// write code here
res := make([]byte, 0)
for i:= len(str) - 1 ; i >=0 ; i-- {
res = append(res, str[i])
}
t := string(res)
return t
}