Swift solution 12ms


  • 2
    Z
    class Solution {
    func reverseString(s: String) -> String {
        var inReverse = ""
        for letter in s.characters {
            inReverse = "\(letter)" + inReverse
        }
        return inReverse
    }
    

    }


Log in to reply
 

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