Swift,easy!!!


  • 0
    T
    class Solution {
        func reverseString(_ s: String) -> String {
            var result:String = ""
            for stringElement in s.characters.reversed() {
                 result += String(stringElement)
            }
            return result
         }
    }

Log in to reply
 

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