葉林
Linked with GitHub
# LeetCode - 0344. Reverse String ### 題目網址:https://leetcode.com/problems/reverse-string/ ###### tags: `LeetCode` `Easy` `字串` ```cpp= /* -LeetCode format- Problem: 344. Reverse String Difficulty: Easy by Inversionpeter */ class Solution { public: void reverseString(vector<char>& s) { if (!s.size()) return; int half = s.size() >> 1; for (int i = 0; i < half; ++i) swap(s[i], s[s.size() - i - 1]); } }; ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up