Jump to content

Balanced brackets: Difference between revisions

m
tweak formatting of task
m (whitespace)
m (tweak formatting of task)
Line 1:
{{task}}
'''Task''':
* Generate a string with <codemath>$\mathrm{N}</codemath> opening brackets (<code>"["</code>) and <codemath>$\mathrm{N}</codemath> closing brackets (<code>"]"</code>), in some arbitrary order.
* Determine whether the string is <em>''balanced</em>''; that is, whether it consists entirely of pairs of opening/closing brackets (in that order), none of which mis-nest.
 
'''Examples''':
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.