AdventOfCode2020 icon indicating copy to clipboard operation
AdventOfCode2020 copied to clipboard

Wild

Open alper opened this issue 5 years ago • 1 comments

Totally wild that this could be done in a fold. Kudos!

https://github.com/AxlLind/AdventOfCode2020/blob/1157ff5e49343526c42c504a267d8c8427f06f6d/src/bin/15.rs#L8

alper avatar Dec 16 '20 09:12 alper

Thanks, I appreciate it! This implementation definitely wasn't my initial one but the more I looked at it the more it simplified into a single fold at the end 😅 The fact that HashMap::insert() returns the previous value is really what made it so clean.

AxlLind avatar Dec 16 '20 12:12 AxlLind