A bundler report shows each chunk's size in bytes. To explain how evenly a chunk can be split, it lists the size's prime factors.
Write primeFactorsOf(n) that returns the prime factors of n in ascending order, with each prime repeated as many times as it divides n. For n = 1, return [].
Input: n = 12 Output: [2,2,3]
12 = 2 × 2 × 3.
Input: n = 13 Output: [13]
13 is prime, so it is its own only prime factor.
1 <= n <= 10^12Run tries your code on the examples. Submit runs every test, including hidden edge cases, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #646 Prime Factors of a Bundle Size. I give hints, never the solution, so you get to solve it yourself. Ask for a hint, select code to ask about it, or press Ask Tuto why on a failing test.
Your first 3 answers need no account. for free to keep asking.