I am passing only one test case.
Playing with card in stack challenges
Hello @Satyamcoder,
Your solution is incorrect.
Mistakes:
-
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. -
Your code runs for only one iteration while you have to iterate q times.
See the correct approach:
Hope, this would help.