Recursion output cannot be static


#1

Hi Guys my code is returing
() (())
and interviewbit expecting
(()) ()
it should not check sequence both are correct answers kindly fix this issue


#2

Sure that both should be in the output array/vector. BTW, did you arrange the output in ascending order (string comparison)?


#3

sort and print it will work as mentioned above you required sorted arraylist.


#4

Reversing the list worked for me. Both the answers should have marked as correct by the platform. not sure why its like that.