Make Unreal REAL.
article thumbnail
Level 0. 문자열 여러 번 뒤집기

 

 

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

string solution(string my_string, vector<vector<int>> queries)
{
    for (vector<int>& query : queries)
        reverse(my_string.begin() + query[0], my_string.begin() + ++query[1]);

    return my_string;
}
profile

Make Unreal REAL.

@diesuki4

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

검색 태그