Factorization problem

here I just used map to store all the values which are either primes or they have primes as a factor and answer variable to take XOR only if new prime is encountered and if ans!=0 then first will win other wise second
here is my code:-

Hey @Love
Your approach is incorrect. You just need to find and store the highest power of primes present in any element in the array. After that apply xor to these values.

If your doubt is resolved please mark it as closed.

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.