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.
Register | Usage | Type | Description |
---|---|---|---|
$a0 |
input | address | null-terminated input string |
$v0 |
output | boolean | input has matching brackets (0 = false , 1 = true ) |
$t0-9 |
temporary | any | used for temporary storage |
Sign up to Exercism to learn and master MIPS Assembly with 47 exercises, and real human mentoring, all for free.