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

kef

12/10/2018, 12:53 AM
Hi, can you help me understand why I got such a strange execution times with my solution for the last challenge? https://kotlinlang.slack.com/archives/C0922A726/p1544400345429600
l

littlelightcz

12/10/2018, 11:49 AM
If you're literally doing
current.prev.prev.prev.prev.prev.prev.prev
- these are nested calls which could be expensive (I think). Try doing it like
repeat(7) { current = current.prev }
k

kef

12/11/2018, 5:51 PM
Yeah, I’ve tried that first. Got same execution time as with
.prev.prev
.
5 Views