prime factorization problem! help!

If p^2 is a multiple of both 12 and 42, and p is a positive integer, what is the least possible value of p?

Hello, is the answer 1764?? if so I think this way of solving can be correct
12’s prime factors are 2,2,3
42’s prime factors are 2,3,7
If we list all the common factors in one group: 2 2 3 2 3 7
One 2 and One 3 are common to both 12 and 42 so we don’t have to write them twice
Thus the list becomes 2 2 3 7
If we multiply them, we get 84
However we want to get a number whose square root is an integer
Prime factors of 84 are 2 2 3 7
2*2 equals 4 whose square root is 2
if we add prime factors 3 and 7 (because two 3’s square root is 3 two 7’s square root is 7) the list becomes
2 2 3 3 7 7
If we multiply them we get 1764
Hope it’s correct, if not oh well haha

Same answer, different explanation:

List the factors of each: 12 = 2x2x3, 42 = 2x3x7

To find LCM, multiply each factor to it’s highest power.
But your multiple needs to be a perfect square-- that means pairs of identical factors:
2x2 x 3x3 x 7x7

4 x 9 x 49 = 1764

It’s asking for the smallest possible value of p (not p^2), which is 42 in this case. The answer is 42.

OH, man, you’re right!!!

yep the answer is 1764. Thank you guys !

i meant p^2=1764 and p=42