Write a function that takes a string as input and returns the string
reversed.Example: Given s = “hello”, return “olleh”.
class Solution {
func reverseString(s: String) -> String {
var strRev:String = ""
var charts:[Character] = []
for chart in s.characters {
charts.append(chart)
}
for chart in charts.reverse() {
strRev.append(chart)
}
return String(strRev)
}
}