first commit

This commit is contained in:
=
2024-02-07 15:06:50 +01:00
commit af02e453c1
55 changed files with 2166 additions and 0 deletions

1
p22/p022_names.txt Normal file

File diff suppressed because one or more lines are too long

15
p22/solution.jl Normal file
View File

@@ -0,0 +1,15 @@
function solution()
file_str = ""
open(f -> file_str = read(f, String), "p22_/p022_names.txt")
file_str_cleaned = replace(file_str, "\"" => "")
names = sort!(split(file_str_cleaned, ","))
n = length(names)
f = char -> (Int(char) - 1)%32 + 1
score = 0
for i = 1:n
score += sum(f.(collect(names[i])))*i
end
return score
end
println(solution())