Why my code is giving one wrong answer?

Your code doesn’t check if there are more than 1 two in prime factorisation!


see this