Problem 59821. Largest Prime Factor
Write a function largest_prime_factor(n) that takes a positive integer n as input and returns the largest prime factor of n. A prime factor is a factor that is a prime number. For example, the largest prime factor of 12 is 3.
Solution Stats
Problem Comments
-
2 Comments
Christian Schröder
on 1 Apr 2024
Your test suite is unpassable due to the trailing "end". Please, use a reference solution when creating problems and verify that it passes the test suite. Thank you.
Grace
on 9 Apr 2024
The "end" does not allow the solution to work, for future reference try using the reference solutions to verify the test suite is passable.
Solution Comments
Show commentsProblem Recent Solvers0
No solvers yet, be the first player to solve this problem.
Suggested Problems
-
0 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!