Why my solution got Error: 12,37: ')' expected.
function should return True or False ?
I ran this function in browser with your examples and all works
function brackets(expr: string): boolean {
let d = expr.replace(/([+=/*-])/g, '').replace(/[0-9]/g, '');
while(d.includes('[]') || d.includes('{}') || d.includes('()')){
d = d.replace('()', '').replace('{}', '').replace('[]', '');
}
return d == '';
}
Created at: 2020/05/01 13:34; Updated at: 2020/05/06 03:24