코딩테스트 연습 > 스택/큐 > 쇠막대기
-
스택/큐 > 쇠막대기프로그래머스(Programmers) 2018. 9. 26. 21:23
https://programmers.co.kr/learn/courses/30/lessons/42585 1. 문제 2. 알고리즘키워드 - 스택 3. 코드 12345678910111213141516171819202122232425262728293031#include #include #include using namespace std; int solution(string arrangement) { int answer = 0; const int size = arrangement.size(); stack s; char before = 0; for (int i = 0; i