https://programmers.co.kr/learn/courses/30/lessons/12973?language=cpp

int solution(string s)
{
    std::stack<char> stackS;
    stackS.push(s[0]);
    for(int i = 1; i < s.size(); i++){
        if(stackS.empty() || stackS.top() != s[i]){
            stackS.push(s[i]);
        }else{
            stackS.pop();
        }
    }
    
    return stackS.empty() ? 1 : 0;
}