This is what I get if I run it here. () (((()))) ((()())) ((())()) ((()))() (()((


#1

This is what I get if I run it here.
() (((()))) ((()())) ((())()) ((()))() (()(())) (()()()) (()())() (())(()) (())()() ()((())) ()(()()) ()(())() ()()(()) ()()()()
The expected returned value :
(((()))) ((()())) ((())()) ((()))() (()(())) (()()()) (()())() (())(()) (())()() ()((())) ()(()()) ()(())() ()()(()) ()()()()

Though when I run the same code in my system, it works fine. Custom input also gives the correct answer. Whats the issue here ?


#2

I am getting the same issue. @admin Please check and remove the error!


#3

It’s actually working fine. No error shown for my code.


#4

Check if you are using any global variables. Clear them before use. Global variables cause such problems.


#5

sort the output before submitting


#6

I had the same issue when I tried using a global/static variable. It worked fine when I used it as a local variable and passed it in my recursive function.


#7

Don’t use global variable, had the same issue.


#8

Worked for me when I sort the vector.


#9

do a list.clear() in main;
i.e clear your global array for every input.