Problem Summaries (2021)

(Summaries of problems to latest posting.)

Day 1: Sonar Sweep

Part 1:

Given a series of depth readings, count the number of times the depth increases from one measurement to the next.

Part 2:

Consider a three-measurement sliding window. How many of the sliding window sums are greater than the previous sum?

Day 2: Dive

Part 1:

Starting at position and depth 0, and given a series of course commands (forward x, down y, up z), determine final position and depth.

(Down and Up x increase and decrease depth by x respectively. Forward x increases increases position by x.)

Part 2:

Determine final position and depth with new rules.

Down x increases Aim by x.

Up x decreases Aim by x.

Forward x increases position by x AND increases depth by Aim * x.

Day 3: Binary Diagnostic

Part 1:

Given a series of binary numbers (diagnostic report), determine the gamma rate and epsilon rate, convert these to decimal representation and multiply together to obtain power consumption.

Each bit in the gamma rate is the most common bit in the corresponding position of the numbers in the report.

Each bit in the epsilon rate is the least common bit in the report data.

Part 2:

From the same report, determine the O2 gen rating and the CO2 scrub rating and multiply these together to obtain the life support rating.

O2 gen rating: Iterate through bit positions, retaining at each, only the values that have the most common bit in that position. If 0 and 1 are equally common, keep values with 1.

CO2 scrub: Iterate through bit positions, retaining at each, only the values that have the least common bit in that position. If 0 and 1 are equally common, keep values with 0.

Day 4: Bingo with Giant Squid

Part 1:

Given a series of draws and a series of bingo squares, considering only rows and columns, determine which is the winning board, and determine its score as the sum of the unmarked numbers * the last number drawn.

Part 2:

Determine which board wins last and score it as above.

Day 5: Hydrothermal Vents

Part 1:

Given a series of vent lines specified by endpoint coordinates as x1,y1 -> x2,y2, and considering only horizontal and vertical lines, determine the number of points where at least two lines overlap.

Part 2:

Do the same, with diagonal lines included.

Day 6: Lanternfish Population Growth

Part 1:

Given the following lanternfish properties:

Each fish has an internal timer that sets to 8 on birth.

Timer counts down 1 each day.

On the day after timer reaches 0, timer is reset to 6 and a new fish is spawned.

And given a list of timer values for current population, determine entire population after 80 days.

Part 2:

Determine population after 256 days.

Day 7: Aligning Crab Submarines with least fuel consumption

Part 1:

Given a series of positions in a line (each representing the position of one crab submarine), determine the position of convergence of all crab subs that results in the least total fuel consumption, and what the total fuel consumption is. (Each unit change in position by one crab sub consumes one unit of fuel.)

Part 2:

Determine the same when each unit change in position costs one more unit of fuel than the last.

Day 8: Decoding Output of Digital Displays

Given a set of segment patterns that correspond to specific digits in the digital displays, and given sets of patterns in which the correspondence between the input signals and active display segments has been corrupted, decode the patterns to determine what the display outputs should be.

Day 9: Smoke Basins

Part 1:

Given a rectangular array of elevations, find the basin bottoms (the points in the array that are surrounded on four sides either by higher elevations or the edges of the array).

Part 2:

In the above array, the basins are defined by an irregular  web of ridges and the edges of the array. Find the size (number of points contained within) of the three largest basins.

Day 10: Syntax Scoring

Part 1:

Given a set of text lines consisting of sequences of opening and closing brackets of four types, find the corrupt lines and score according to the first illegal character.

Part 2:

Given the same input as above, discard the corrupt lines, then determine the sequence of closing characters needed to complete each of the remaining  lines. Score each line and find the median score.

Day 11: Flashing Octopus

Given a square array of energy values ranging from 1 through 9, and the following sequence:

1- Energy levels of all positions are increased by 1.

2- Positions with values > 9 flash.

3- Each position that flashes increases values at all adjacent positions not currently flashing by 1. (If this causes any new positions to have values > 9, cascading ensues till no more flashes occur.

4- Values of all positions that flashed in current step are set to zero, step is incremented and process repeats starting at (1).

Continue until all positions flash simultaneously ( in the same step.)

Determine at which step all positions flash.



Create your website for free! This website was made with Webnode. Create your own for free today! Get started