Improve performance
This commit is contained in:
@@ -36,9 +36,9 @@ function Problem12()
|
|||||||
=#
|
=#
|
||||||
|
|
||||||
function num_divisors(n)
|
function num_divisors(n)
|
||||||
res = floor(sqrt(n))
|
res = floor(Int, sqrt(n))
|
||||||
divs = []
|
divs = []
|
||||||
for i in 1:res
|
for i = 1:res
|
||||||
if n % i == 0
|
if n % i == 0
|
||||||
append!(divs, i)
|
append!(divs, i)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user