All subsequences problem

what is wrong in this code : https://ide.codingblocks.com/#/s/14858
ques link : https://hack.codingblocks.com/contests/c/452/73

You are making vector s as global. Thus, if I give input as
2
ab
ne
Then your output comes as

a
ab
b

a
ab
b
e
n
ne
But, it should be

a
ab
b

e
ne
n
It stores the previous test case’s output as well.Thus, do not make ‘s’ as global

1 Like

You can refer this code as well for it
https://ide.codingblocks.com/#/s/14868

1 Like

thank you for the help :smiley: