올바른 괄호
#include<string> using namespace std; bool solution(string s) { bool answer = true; int now = 0; for(auto ele : s){ if(ele == '(') now++; else if(ele == ')') now--; if(now<0) return false; } if(now!=0) answer = false; return answer; }