d13

package
v0.0.0-...-b6440bf Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed example.txt
	FileExample []byte

	//go:embed input.txt
	FileInput []byte
)

Functions

func SlicesAreEqual

func SlicesAreEqual(a, b []string) bool

func SlicesDifferByOneExactly

func SlicesDifferByOneExactly(a, b []string) bool

Types

type Grid

type Grid struct {
	// Rows are the original pattern as provided.
	Rows []string
	// Cols are the rows rotated.
	Cols []string
}

func ParseGrid

func ParseGrid(rows []string) (*Grid, error)

func (*Grid) Solve

func (g *Grid) Solve(equal func([]string, []string) bool) int

type Mirrors

type Mirrors struct {
	Grids []*Grid
}

func ParseFile

func ParseFile(file []byte) (*Mirrors, error)

func (*Mirrors) SolvePart1

func (m *Mirrors) SolvePart1() int

func (*Mirrors) SolvePart2

func (m *Mirrors) SolvePart2() int

Jump to

Keyboard shortcuts

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