Aaron's Page

This is where I post about what I'm working on.

--- Day 8: Seven Segment Search ---

or..

Yet my VCR still flashes 12:00 to this day...

one art please

Part 1

Python

I started this out the hard way because I figured they'd want the hard way in part two. Yes, I could have just looked at the 4 output numbers and matched on length then summed that, but that didn't really feel like it would be relevant work toward part two.

Go

TBD - honestly, I might not.

Part 2

Python

set.intersections and the fact that I like sudokus were my two perks on this challenge.

set.intersections is a handy way to see the overlap between two unique sets. The nature of this puzzle is that we have unique sets for each digit in the 10 values to decode.

>>>> l1 = list("123456")
>>> l2 = list("345789")
>>> len(set.intersection(set(l1), set(l2)))
3

This is really handy in situations where you know 1 because it's the only value of length two, and you also know that of all the numbers of length 5, the only one that overlaps two values with one is three. Pretty slick! I admittedly did break out a notepad doc to write out all of the logic on what numbers could be determined by what other numbers. I need a whiteboard in my office.

Go

We'll see.

<< - Table of Contents - >>