I didnt get the question or the output in the example is wrong

when we iterate , divisibility check will be between 5/2… 6/3 … 7/5… 4/9…3/9 but in the answer they have considered 4 as divisible… plz help

@dhirenkinha actually, i remains constant for a pile for ith iteration. Initially all cards in A0, so in the ith iteration we check all numbers of A0 against the ith prime number, then when the whole stack is done we move on to the next i, i+1 and repeat the whole process for the i+1th prime number.

1 Like

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.