I have tried to solve this question using this approach but i am not able to get the answer.What is going wrong in my code and how can i correct it?
Playing with cards stack
Plaese solve as guided .A simple approach would be to simply make two arrays of stacks. We can precompute the primes using sieve to save time as you have used. This approach will take a lot of space and reduces time complexity as seive is used .you can go through https://ide.codingblocks.com/s/248565 . Dry run this once you will get to know your mistakes
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.