Prime Factorization
Return the prime factors of n in increasing order, repeating a prime as many times as it divides n. For n = 1 return an empty list.
Example 1
n 12
returns [2,2,3]
12 = 2 * 2 * 3.
Example 2
n 29
returns [29]
29 is prime.
Constraints
1 <= n <= 10**4
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.