Closed FrankKair closed 6 years ago
Keeps looping until half of the input number checking for odd numbers that don't divide the number. The last n is the biggest prime factor.
n
Go
Real time: 0.517 s User time: 0.174 s Sys. time: 0.157 s CPU share: 63.94 %
Lua
Real time: 0.021 s User time: 0.004 s Sys. time: 0.016 s CPU share: 92.30 %
How the solution works
Keeps looping until half of the input number checking for odd numbers that don't divide the number. The last
n
is the biggest prime factor.Performance
Go
Lua