mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-09 15:59:06 +01:00
8 lines
197 B
Swift
8 lines
197 B
Swift
class Solution {
|
|
func reverseString(_ s: inout [Character]) {
|
|
for i in 0..<(s.count / 2) {
|
|
let j = s.count - i - 1
|
|
(s[i], s[j]) = (s[j], s[i])
|
|
}
|
|
}
|
|
}
|