leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

0344.cpp (176B)


      1 class Solution {
      2   public:
      3     void reverseString(vector<char> &s) {
      4         int i = 0, j = (int)s.size() - 1;
      5         while (i < j)
      6             swap(s[i++], s[j--]);
      7     }
      8 };