docs: function balance(str, openers, closers) {
    const stack = [];
  
    // Add each open bracket to the stack, removing them when there is a matching closer
    str.split('').forEach(function(char) {
      const closerIndex = closers.indexOf(char);
      if (closerIndex !== -1 && stack[stack.length-1] === closerIndex) {
        stack.pop();
      } else {
        const openerIndex = openers.indexOf(char);
        if (openerIndex !== -1) {
          stack.push(openerIndex);
        }
      }
    });
  
    // Now the stack should contain all the unclosed brackets
    while(stack.length) {
      str += closers[stack.pop()];
    }
  
    return str;
  }