Playing with card in stack challenges

I am passing only one test case.

Hello @Satyamcoder,

Your solution is incorrect.

Mistakes:

  1. You are computing the modulus with v[q]
    Rather, you have to modulus with i as stated in the question: In ith iteration, you start picking up the cards in Ai-1th pile from the top one by one and check whether the number written on the card is divisible by the ith prime number.

  2. Your code runs for only one iteration while you have to iterate q times.

See the correct approach:

Hope, this would help.