We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6db58f5 commit d465b74Copy full SHA for d465b74
344-reverse-string/344-reverse-string.cpp
@@ -0,0 +1,10 @@
1
+class Solution {
2
+public:
3
+ void reverseString(vector<char>& ch) {
4
+ int s = 0;
5
+ int e = ch.size() - 1;
6
+ while(s<=e)
7
+ swap(ch[s++],ch[e--]);
8
+
9
+ }
10
+};
0 commit comments