Bracket Matching
Create a method in ruby called test_brackets
that takes a string
and determines if all brackets are correctly matching / nested (returns true
or false
). This is code could be used as part of a system to detect syntax errors in code.
It should check for the following: [ ]
,{ }
,( )
Usage Examples
Last updated