Showing posts with label brackets. Show all posts
Showing posts with label brackets. Show all posts

Saturday, March 26, 2011

Valid combinations of "N" pairs of round brackets

Write a method to print all the valid combinations of "N" pairs of round brackets.
Sample Input:
3
Sample output:
((()))
(()())
(())()
()(())
()()()