Write n as a product of primes and return the list of [prime, exponent] pairs in increasing order of the prime. For n = 1 return an empty list.
For n = 360 the answer is [[2, 3], [3, 2], [5, 1]] (360 = 2³ × 3² × 5).
Example 1
Input:
prime_factors(360)
Output:
[[2, 3], [3, 2], [5, 1]]
Example 2
Input:
prime_factors(1)
Output:
[]
1 <= n <= 10**12No results yet
Run your code to check it against the examples, or submit to run every test.