pairs, return every balanced string made of exactly pairs opening and pairs closing brackets, in any order.pairs=2 → ['(())', '()()']
Two pairs give exactly two balanced strings: (()) and ()().
pairs=3 → ['((()))', '(()())', '(())()', '()(())', '()()()']
Five strings: ((())), (()()), (())(), ()(()), ()()(). Something like ())(() does not count: after the third character there are more closing brackets than opening ones.
pairs=1 → ['()']
pairs=2
['(())', '()()']
Run checks the first 3 tests in your browser. Submit checks all 11 tests on the server, hidden ones included.