all 4 comments

sorted by: hot top controversial new old
[–] 8 points 11 months ago (2 children)

it all fit in int64 tho, so could be worse

  • source
  • hideshow 2 child comments
  • [–] 2 points 10 months ago (1 child)

    I always have this thought. I'm doing it in Rust, so I check if there are negative numbers: if not, use usize. But I'm always terrified there will be an overflow somewhere.

    If I were using Kotlin or Java, I might always use BigInteger just out of fear.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 11 months ago

    Considered sticking all the values in a set. Considered input. Coalesced the ranges instead. Ran both parts in 0.1 ms.

    I'm actually looking forward a bit to 12 days this year. Previous AOC took a bit long to ramp up. Am expecting recursion imminently, dynamic programming next week, and complete head scratching bastardry to round out the week.

  • source