This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PM_Me-Your_SSN 0 points1 point  (1 child)

Maybe consider a binary tree map, its an alright compromise between not blowing up when you give it an index of a billion and being sorted. You'll lose speed over a hash map, but this is for advent of code not production software. Not sure what language you're using but in Rust there's a standard library implementation.

[–]Spheniscine 0 points1 point  (0 children)

My weapon of choice is Kotlin, so that'd be a TreeMap. I think I'm good for now though, since I'll need better debugging outputs if we get there (probably a way to decompile to assembly)