You are viewing a single comment's thread. Return to all comments →
Without using stack
let n = -1; while (s.length != n) { n = s.length; s = s.replace('()', ''); s = s.replace('[]', ''); s = s.replace('{}', ''); } if (s.length == 0) return "YES" else return "NO"
Seems like cookies are disabled on this browser, please enable them to open this website
Balanced Brackets
You are viewing a single comment's thread. Return to all comments →
Without using stack