day06

package
v0.0.0-...-08a54c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Part1

func Part1(input string) (string, error)

Part1 returns the largest area, defined as the constant Manhattan distance-radius around one of the input points, that is not infinite.

Important idea: keep track of the furthest left, right, top, and bottom coordinates. If the area for a given point goes beyond one of those coordinates, then its area is infinite.

func Part2

func Part2(input string) (string, error)

Part2 returns the size of the region A such that for each point a in A, the value sum(manhattanDist(a, p) for p in points) is less than 10,000.

NOTE: this assumes that the region will be entirely contained within the bounding box of the points, but this will not be true in all cases.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL