Factorization Game ... is it a question of game theory?

what are the prerequisites for this one … can some hint be provided

@imavneet hey, calculate total powers of all prime number in array. For example - in array [3 18 2 2] total powers of 2 will be 3 and powers of 3 will be 3. Now let me try to relate this problem with a classical game theory problem.

Let prime numbers are piles of stones and their total prime powers in array are equivalent to respective piles size. Now this has become a problem where two players are playing optimally and they reduce every pile to size 0. The last player unable to move loses.

@amankumarkeshu thanks!

@imavneet Yeah no problem. If your issue has been resolved please mark this doubt as resolved.

@amankumarkeshu i tried using the logic and the given test case also passed . but i am still getting WA .

@imavneet
I see you have already solved this question and received 100 points
Great work
So I’m closing this doubt

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.