Given a string containing brackets []
, braces {}
, parentheses ()
, or any combination thereof, verify that any and all pairs are matched and nested correctly.
The string may also contain other characters, which for the purposes of this exercise should be ignored.
Saving state in a useful data type can help here.
Sign up to Exercism to learn and master Pharo with 45 exercises, and real human mentoring, all for free.