r/learnpython • • Dec 02 '19

Advent of Code (AoC) 2019 starts today!

https://adventofcode.com/

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

These puzzles are a great way to practice your Python and problem solving skills.

Edit: added description from AoC site.

336 Upvotes

40 comments sorted by

View all comments

1

u/MiataCory Dec 02 '19

If anyone needs help, I just got through day 2.

I like the add-on questions. "Hey, you did the thing once, now make the computer do it many times!"

3

u/RoadieRich Python 2 diehard Dec 02 '19

I'm curious to know if anyone didn't brute-force day 2 part 2.

2

u/[deleted] Dec 02 '19

There is a handful in the solutions thread that used constraints, yes.

1

u/raglub Dec 03 '19

After brute-forcing the solution, I observed the output of each iteration and realized this is the equation that the Int code solves:

394702 + verb + noun*288000 = 394702 

reduced further:

verb + noun*288000 = 0

Since there are two unknowns and only one equation, I couldn't come up with a clever way to calculated the solution other than brute-forcing it.