12. Reverse String
01 Jul 2020 | Daily Algorithms
class Solution {
public:
void reverseString(vector<char>& s) {
vector<char> copy;
for(char i : s)
{
copy.insert(copy.begin(), i);
}
s = copy;
}
};
class Solution {
public:
void reverseString(vector<char>& s) {
vector<char> copy;
for(char i : s)
{
copy.insert(copy.begin(), i);
}
s = copy;
}
};
Comments