How to check the sequence of opening and closing brackets in string?

后端 未结 5 844
醉酒成梦
醉酒成梦 2020-12-18 14:42

Need to find open and closed bracket, if the sequence of opening and closing brackets is violated, then return false.

But if don\'t revert right array to compare wit

5条回答
  •  自闭症患者
    2020-12-18 15:15

    I hope this will solve your problem...

    function brackets(expression) {
        let leftArr=[];
        
        for(let i=0; i

提交回复
热议问题