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;
}
'자료구조 & 알고리즘 > 프로그래머스' 카테고리의 다른 글
Level 0. ad 제거하기 (0) | 2023.07.03 |
---|---|
Level 0. 9로 나눈 나머지 (0) | 2023.07.02 |
Level 0. 대소문자 바꿔서 출력하기 (0) | 2023.06.30 |
Level 0. 문자열 섞기 (0) | 2023.06.29 |
Level 0. 콜라츠 수열 만들기 (0) | 2023.06.28 |