자료구조 & 알고리즘/프로그래머스

Level 0. 문자열 뒤집기

diesuki4 2023. 7. 1. 05:21
Level 0. 문자열 뒤집기

 

 

#include <iostream>
#include <algorithm>

using namespace std;

string solution(string my_string, int s, int e)
{
    reverse(my_string.begin() + s, my_string.begin() + ++e);

    return my_string;
}
저작자표시 비영리 변경금지 (새창열림)