diff --git a/src/Julia/Problem022.jl b/src/Julia/Problem022.jl index 8610c86..11e714d 100644 --- a/src/Julia/Problem022.jl +++ b/src/Julia/Problem022.jl @@ -24,10 +24,10 @@ function Problem22() What is the total of all the name scores in the file? =# file = "/datos/Scripts/Gitea/Project_Euler/src/files/Problem22.txt" - names = readdlm(file, ',', String) + names = sort(readdlm(file, ',', String)[:]) result = 0 - for (idx, name) in enumerate(sort(names[1:end])) + for (idx,name) in enumerate(names) result += sum(Int(c) - 64 for c in name) * idx end return result