please explain what to do in this chsllange
Playing with cards in stack
Hi,
Follow the following steps:
- Take input in a stack.
- one by one pick the element of stack and check its divisibility with first prime.
- if number is divisible put in stack(say A) and the others in stack B.
- print the numbers in stack A.
- Follow same process for stack B again but now you should check divisibility with second prime.
Again after whole process check divisibility with third prime and so on until q queries.