DEV Community

Discussion on: Advent of Code 2020: Day 05 with Python

Collapse
 
ljcdev profile image
ljc-dev

Lol as expected that wasn't much of a challenge to u 😁. I had such a hard time 😭.
Part 1 Got it using reduce, switch, math.round etc. Then Simon told me to use binary.
For part 2 I used a convoluted divide and conquer logic 😂. Then Simon again suggested a simpler way with Set and find.
Btw, python set difference is such an awesome feature 😍.

Collapse
 
meseta profile image
Yuan Gao

You don't have to do everything Simon says you should...oh wait, maybe you do have to do everything Simon says...

Yep, if you don't use binary, you'd have to do a lot more parsing, but it's a valid solution! Don't worry if you're finding it challenging, hopefully as you figure things out, even if it takes a while, you're learning, and also having a look at other solutions once you've done yours should help to give you more ideas to use in the future if you encounter similar issues. Good luck with the other challenges!