Given an input x, find its all prime factors. Return the vector with all factors in ascending order.
Efficiency is the key here.
Example 1:
x = 4
y = [2]
Example 2:
x = 6270
y = [2 3 5 11 19]
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers62
Suggested Problems
-
Project Euler: Problem 5, Smallest multiple
1651 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1265 Solvers
-
Write a code that will follow the equation y = x * (x + x) * x.
358 Solvers
-
234 Solvers
-
1489 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!