Refactoring
This commit is contained in:
parent
90e6ce9490
commit
c3a6144a08
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user