Time Lapse :6min 0sec solution.cpp123456789101112131415161718192021222324#include <string>#include <vector>using namespace std;int solution(string arrangement) { int answer = 0; int sticks = 0; for(int i=0;i<arrangement.length();i++){ if(arrangement[i]=='('){ if(arrangement[i+1]=='(') ++sticks; else{ answer += sticks; ++i; } } else{ ++answer; --sticks; } } return answer;}