https://school.programmers.co.kr/learn/courses/30/lessons/12973
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
#include <iostream>
#include<string>
#include <stack>
#include <algorithm>
using namespace std;
int solution(string s)
{
//24.10.15
stack<char> st;
for_each(s.begin(), s.end(), [&](const auto& ch) {
(st.empty() || st.top() != ch) ? st.push(ch) : st.pop();
});
return st.empty();
}
[level 2] Title: 짝지어 제거하기, Time: 5.78 ms, Memory: 6.39 MB -BaekjoonHub · developeSHG/Algorithm-Baekjoon_Programme
developeSHG committed Oct 14, 2024
github.com
'Coding Test > Programmers' 카테고리의 다른 글
[Programmers] (Summer/Winter Coding(~2018)) Lv 2. 점프와 순간 이동 (0) | 2024.10.17 |
---|---|
[Programmers] (힙(Heap)) Lv 2. 더 맵게 (0) | 2024.10.15 |
[Programmers] (Summer/Winter Coding(~2018)) Lv 2. 배달 (0) | 2023.12.04 |
[Programmers] Lv 2. 줄 서는 방법 (0) | 2023.11.16 |
[Programmers] (2021 Dev-Matching: 웹 백엔드 개발자(상반기)) Lv 2. 행렬 테두리 회전하기 (0) | 2023.11.14 |
댓글