Playing with cards


only 1 test case got passes.whats the error??

hello @samardeep

u have misunderstood the problem .

u dont have to iterate the array again n again.

this is the problem ->
u need to perform the given operation Q number of times.

initially in the question u are given a stack A0 , and a number q(number of times u need to perfrom the operation)

now using A0 u need to obtain A1 and B1
now using A1 u need to obtain A2 and B2
now using A2 u need to obtain A3 and B3
now using A3 u need to obtain A4 and B4
…
…
…
now using Aq-1 u need to obtain Aq and Bq

at the end u need to print content of B1 ,B2,B3,…Bq , Aq

Please elaborate, I didnt understand

@samardeep
read this

and then check this example->
ss

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.