---
# System prepended metadata

title: 344-Reverse String
tags: [Easy]

---

# 344-Reverse String
###### tags: `Easy`
## Question
https://leetcode.com/problems/reverse-string/
## Key
1. use a new string back store original string
2. swap front and behind (in-place)
## Reference
## Solution
```cpp=
class Solution {
public:
    void reverseString(vector<char>& s) {
        char j = 'a';
      for (int i = 0; i < s.size() / 2; i ++ ){
        j = s[i];
        s[i] = s[s.size() - i - 1];
        s[s.size() - i - 1] = j;
        }
    }
};
```

