https://kotlinlang.org logo
#advent-of-code
Title
# advent-of-code
t

Tolly Kulczycki

12/11/2023, 3:24 PM
Having some issues with Part 2, need some help, code and explanation in thread
Untitled.kt
so I'm doing fine when tackling the test input with 10 and 100
so I dunno why it'd be wrong here
j

Johannes Gätjen

12/11/2023, 3:26 PM
What order of magnitude solution size are you expecting? 😉
t

Tolly Kulczycki

12/11/2023, 3:27 PM
Right
It was just too big for int
ehhhh
Should've checked that first
Thanks for pointing it out
works now
just had to convert to Longs
I swear the Longs lobby is strong this year
j

Johannes Gätjen

12/11/2023, 3:29 PM
👍 classic. In my solution template I have return type as Long by default just to remind myself that I might need to change it.
j

Jonathan Kolberg

12/11/2023, 5:52 PM
Yeah common wisdom is, every solution should be able to be computed in Long
e

ephemient

12/13/2023, 12:35 PM
though if you're compiling Kotlin to JS, Long is significantly slower as it needs to be emulated instead of doing through Number
2 Views