I have followed the implementation from the video provided and still, i am receiving an error on submitting my code.
def generate_parentheses(opening_brackets, closing_brackets, n, s=[]):
if closing_brackets == n:
print(''.join(s))
return
else:
if closing_brackets < opening_brackets:
s.append(')')
generate_parentheses(opening_brackets, closing_brackets + 1, n, s)
s.pop()
if opening_brackets < n:
s.append('(')
generate_parentheses(opening_brackets + 1, closing_brackets, n, s)
s.pop()
return
for n in range(1, 11):
generate_parentheses(0, 0, n)