Loading...
You are given an integer n. Return every balanced string made of exactly n ( characters and n ) characters, in any order.
n
(
)
A string is balanced if every prefix has at least as many ( characters as ) characters, and the string as a whole has the same number of each.
Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"]
Input: n = 1 Output: ["()"]