Skip to content

Bug Report for validate-parentheses #4458

@HimanshuParihar99

Description

@HimanshuParihar99

Bug Report for https://neetcode.io/problems/validate-parentheses

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

please change the cases beacause i just write a wrong code and the cases are accepted!!

this is my code:

isValid(s) {
let par = {
'}':'{',
']':'[',
')':'('
}

    for(let p of s){
        if(p == par){
            return false;
        }else{
            return true;
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions