Ad
  • Custom User Avatar

    It was very tricky to do this using only RPN, but it is possible to contort shunting-yard to handle this.

    If you're confused about the add/str interface that isn't explained much in the C++ version, look at the Rust version where this interface is just a vector. The C++ interface is equivalent but str creates a new vector with an initial element and add appends to an existing vector from str. Understanding this representation also clarifies the unexplained aspects of how the pretty-printer used to validate the test cases handles parentheses.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution