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
I hope this will solve your problem...
function brackets(expression) { let leftArr=[]; for(let i=0; i