Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 1
    nice indeed! esp leveraging the precondition opening-braces >= closing-braces. Commented Apr 8, 2009 at 13:36
  • 1
    @Prabhu Jayaraman - with which input will it produce invalid pairs ? The conditions restrict it to never add a closing bracket if there are not already opening brackets, so I do not think you are correct. Commented Aug 6, 2010 at 15:17
  • 1
    @Prabhu Jayaraman - why ? Please give me an example input that produces incorrect results. Commented Aug 6, 2010 at 15:46
  • OOps very sorry markt. wrong judgement. i thought close<pairs +1 Commented Aug 6, 2010 at 17:16
  • 1
    Very elegant solution.. you nailed recursion! Commented Sep 11, 2010 at 5:37