Ad
  • Custom User Avatar

    "if (':' == ch) {var a = stack.pop()||0; stack.push(a, a)};"
    for this case, if there is nothing in the stack, your code is going to push 2 "0" into the stack. Is it so?
    But the description mentions": Duplicate value on top of the stack. If there is nothing on top of the stack, push a 0."