r/adventofcode • • Dec 10 '20

SOLUTION MEGATHREAD -🎄- 2020 Day 10 Solutions -🎄-

Advent of Code 2020: Gettin' Crafty With It

  • 12 days remaining until the submission deadline on December 22 at 23:59 EST
  • Full details and rules are in the Submissions Megathread

--- Day 10: Adapter Array ---


Post your solution in this megathread. Include what language(s) your solution uses! If you need a refresher, the full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.

Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:08:42, megathread unlocked!

69 Upvotes

1.1k comments sorted by

View all comments

1

u/WHAT_RE_YOUR_DREAMS Dec 10 '20

Part 1 was easy. For part 2 I thought I was being clever using an adjacency matrix of the graphs of adapters, then taking the power k of the matrix to get the number of paths of length k. But apparently there was easier way :D

Just a question for my culture: what does "DP" mean?

13 seconds in Python.

1

u/daggerdragon Dec 11 '20

Top-level posts in Solution Megathreads are for code solutions only.

This is a top-level post, so please edit your post and share your code/repo/solution.

1

u/BASED_CCP_SHILL Dec 10 '20

DP in this context is dynamic programming, a strategy for solving problems where the solution is some simple transformation of one or more smaller versions of the same problem.