r3da / misc

1 stars 1 forks source link

Matching Braces #6

Open r3da opened 10 years ago

r3da commented 10 years ago

Create a program that takes as input an integer n, and outputs all possible combinations of matching opening/closing parentheses of count n. example: n=3 ((())) (())() (()()) ()()()

axeliux commented 10 years ago

I think It is still wrong: axel@axel-VirtualBox:~$ java MatchingBraces 4 The result is: [(((()))), ()((())), (()(())), ()()(()), ((()())), ()(()()), (()()()), ()()()()] for input 4 I don't see this case: (()) (())