This was the literal assignment:
Let $x = p_1^{n_1} \cdots p_k^{n_k}$ and $y = p_1^{m_1} \cdots p_k^{m_k}$ be the prime factorizations of $x$ and $y$, respectively, where prime factors $p_i$ appear at least in one of their prime factorizations $x$ and $y$ (thus some of the exponents $n_i$ or $m_i$ may be $0$). What is the factorization of $\gcd(x,y)$?
My attempt at an answer was: $\gcd(x, y) = p_1^{\min\{n_1, m_1\}} \cdots p_k^{\min\{n_k, m_k\}}.$
However, I'm not entirely sure if this is correct in all cases and if I can assume when putting the $p_i$ in order, the comparison in the exponents ($\min\{\ldots,\ldots\}$) is done through the same prime factor. A second opinion would be nice!
Your formula is correct. The provision that some of the exponents could be 0 is so that the exact same set of primes is used for both numbers. $p_i$ is the same for both $x$ and $y$.