No output plz help
Provide the solution link correctly
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
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