Browse Source

Cleaned up some julia notation sum -> count

main
Micah Halter 4 months ago
parent
commit
503d9981af
Signed by: mehalter GPG Key ID: 4224A6EA9A8CAAA8
  1. 4
      2015/src/day_5.jl
  2. 4
      2020/src/day_4.jl
  3. 2
      2020/src/day_7.jl

4
2015/src/day_5.jl

@ -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)

4
2020/src/day_4.jl

@ -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)

2
2020/src/day_7.jl

@ -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