Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
updated description
My prime-factorization based solution became faster at n = 10000
Averages of 250 testcases
Random numbers up to 10^1: Prime factors: 0.000 s, naive = 0.000 s
Random numbers up to 10^2: Prime factors: 0.001 s, naive = 0.001 s
Random numbers up to 10^3: Prime factors: 0.007 s, naive = 0.004 s
Random numbers up to 10^4: Prime factors: 0.044 s, naive = 0.044 s
Random numbers up to 10^5: Prime factors: 0.289 s, naive = 0.456 s
Random numbers up to 10^6: Prime factors: 3.563 s, naive = 5.182 s
Random numbers up to 10^7: Prime factors: 26.995 s, naive = 56.739 s
Your code fails for 143 = 13 * 11, or other numbers which have prime factors other than 2,3,5 and 7
Could you include the constraint that leading zeroes are not allowed to the description?