Balanced brackets: Difference between revisions

Content added Content deleted
m (→‎with 40 examples: changed the wording in the output section.)
m (used highlighting instead of quoted strings in the task requirements.)
Line 1:
{{task}}
 
'''Task''':
* Generate a string with <math>\mathrm{&nbsp; '''N}</math>''' &nbsp; opening brackets (“&nbsp; <codebig>'''['''</codebig>”) &nbsp; and <math>\mathrm{with &nbsp; '''N}</math>''' &nbsp; closing brackets (“&nbsp; <codebig>''']'''</codebig>”), &nbsp; in some arbitrary order.
* Determine whether the generated string is ''balanced''; that is, whether it consists entirely of pairs of opening/closing brackets (in that order), none of which mis-nest.