1
0

main.jl 385 B

1234567891011121314
  1. input = readlines(joinpath(splitdir(@__FILE__)[1], "input"))
  2. ids = input .|> x -> foldl(replace, ["F"=>"0", "B"=>"1", "L"=>"0", "R"=>"1"], init=x) |> x-> parse(Int, x, base=2)
  3. function max_id()
  4. maximum(ids)
  5. end
  6. function what_seat()
  7. setdiff(minimum(ids):maximum(ids), ids)[1]
  8. end
  9. println("max id: $(@btime max_id())")
  10. println("what seat: $(@btime what_seat())")