Golang solution


  • 0
    M

    func reverseString(s string) string {
    r := []rune(s)
    var buf bytes.Buffer
    for index := len(r) - 1; index >= 0; index-- {
    buf.WriteRune(r[index])
    }
    return buf.String()
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.