day16

package
v0.0.0-...-38c8f7e Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldName

type FieldName string

type FieldRange

type FieldRange struct {
	Min, Max int
}

func (FieldRange) IsValid

func (f FieldRange) IsValid(n int) bool

type FieldRanges

type FieldRanges []FieldRange

func (FieldRanges) IsValid

func (fs FieldRanges) IsValid(n int) bool

type Input

type Input struct {
	Fields        map[FieldName]FieldRanges
	YourTicket    Ticket
	NearbyTickets []Ticket
}

func ParseInput

func ParseInput(groups [][]string) (*Input, error)

func (*Input) Part1

func (in *Input) Part1() int

Part1 has the side-effect of removing invalid tickets from i.NearbyTickets.

func (*Input) Part2

func (in *Input) Part2() (int, error)

Part2 has the side effect of removing elements from in.Fields.

type Ticket

type Ticket []int

Jump to

Keyboard shortcuts

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