No output plz help

https://ide.codingblocks.com/#/s/180

15

Provide the solution link correctly

https://ide.codingblocks.com/#/s/18102

@abhishek_trigunait
help bhaii

In the playing_with_cards function, you’ve declared stack<int> A,B; inside it. So when you do playing_with_cards(A,i+1,Q), A and B are reinitialised. That’s why A becomes empty in the next iteration.

i m not getting this …

In line 36 you’ve called playing_with_cards(A,i+1,Q), Now when it goes for the next iteration, it processes stack<int> A,B; and declares new stacks A and B. So the old instance of stacks get destroyed.

can u share the code.again it’s no output

https://ide.codingblocks.com/#/s/19165

1st nd 2nd case wrong anwers.

The output format is a bit confusing which gives WA, this is the modified code btw https://ide.codingblocks.com/#/s/19348 Still WA but this is what you needa do