Return an array containing prime numbers whose product is x, e.g. primeFactorization(12) == [2,2,3]
Asked in the CoderPad stage.
Implement primeFactorization(x). Given an integer x >= 2, return a list of prime factors whose product equals x, including repeated factors. Return the factors in nondecreasing order.
Examples:
x = 12 returns [2, 2, 3] because 2 * 2 * 3 = 12.x = 13 returns [13] because 13 is prime.Input: one integer x.
Output: a list of prime integers.
def primeFactorization(x):