programmers-coding-test icon indicating copy to clipboard operation
programmers-coding-test copied to clipboard

올바른 괄호 정답 | Hyun Seok Park

Open ssseok opened this issue 3 years ago • 0 comments

@Hyun Seok Park 님의 정답이에요! 👏👏👏

제출한 정답

function solution(s){
    let count = 0;
    for(const a of s) {
        a === "(" ? count++ : count--;
    if(count < 0) return false;
    }
    return count === 0;
}

풀이 데이터

{
  "probId": "12909",
  "author": "Hyun Seok Park",
  "lang": "JavaScript",
  "createdAt": 1679579165107
}

ssseok avatar Mar 23 '23 13:03 ssseok