Browse Source

Cleaned up some julia notation sum -> count

main
Micah Halter 1 month ago
parent
commit
503d9981af
Signed by: mehalter GPG Key ID: 4224A6EA9A8CAAA8
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      2015/src/day_5.jl
  2. +2
    -2
      2020/src/day_4.jl
  3. +1
    -1
      2020/src/day_7.jl

+ 2
- 2
2015/src/day_5.jl View File

@ -15,11 +15,11 @@ function valid_line2(line)
end
function part_1(input)
sum(valid_line1.(input))
count(valid_line1, input)
end
@info part_1(input)
function part_2(input)
sum(valid_line2.(input))
count(valid_line2, input)
end
@info part_2(input)

+ 2
- 2
2020/src/day_4.jl View File

@ -51,11 +51,11 @@ function valid_passport2(passport)
end
function part_1(input)
sum(map(valid_passport1, parse_passports(input)))
count(valid_passport1, parse_passports(input))
end
@info part_1(input)
function part_2(input)
sum(map(valid_passport2, parse_passports(input)))
count(valid_passport2, parse_passports(input))
end
@info part_2(input)

+ 1
- 1
2020/src/day_7.jl View File

@ -46,7 +46,7 @@ end
bags = Dict(parse_rule.(input))
part_1 = sum(contains_bag.(keys(bags), "shiny gold"))
part_1 = count(bag->contains_bag(bag, "shiny gold"), keys(bags))
@info part_1
part_2 = contained_bags("shiny gold")

Loading…
Cancel
Save