LeetCode #344

Reverse String

1개의 풀이 · C++

문제 원문 보기 ↗

SOLUTION INFO

C++ · main.cpp

main.cpp
#include<algorithm>

class Solution {
public:
    void reverseString(vector<char>& s) {
        vector<char> other;
        for(int i=s.size()-1;i>=0;i--){
            other.push_back(s[i]);
        }
        s = other;
    }
};

SOLUTION DESCRIPTION

풀이 설명

등록된 풀이 설명이 없습니다.