Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • \$\begingroup\$ Closely related. (Same output, different input.) \$\endgroup\$ Commented Nov 22, 2016 at 21:47
  • \$\begingroup\$ I'm not a regular on this site, if you think the question can be improved please comment or edit directly. Thanks! \$\endgroup\$ Commented Nov 22, 2016 at 21:47
  • \$\begingroup\$ what is the exact input format? Is it a string or an object? \$\endgroup\$ Commented Nov 22, 2016 at 22:00
  • \$\begingroup\$ @Ludonope Whatever makes your code easier. See note 3. I expect most people will use an object, because writing a parser is probably not fun, but I don't want to discourage any possible interesting stack based approaches. \$\endgroup\$ Commented Nov 22, 2016 at 22:07
  • 4
    \$\begingroup\$ The characters │, ├, └, ─ are conveniently available in most languages, but each one requires 3 bytes in UTF8, so using the ASCII gives a better score \$\endgroup\$ Commented Nov 24, 2016 at 16:02