diff --git a/src/Julia/Problem014.jl b/src/Julia/Problem014.jl index ae71e2a..22d2e89 100644 --- a/src/Julia/Problem014.jl +++ b/src/Julia/Problem014.jl @@ -16,7 +16,7 @@ function chain_length(n, terms) break end if n % 2 == 0 - n = n / 2 + n = n รท 2 else n = 3n + 1 end @@ -50,7 +50,8 @@ function Problem14() ans = 0 limit = 1_000_000 score = 0 - terms = Dict() + terms = Dict{Int, Int}() + sizehint!(terms, limit) for i in 1:limit terms[i] = chain_length(i, terms) if terms[i] > score