day02

package
v0.0.0-...-f4b2804 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const REQUIRED_BLUE_CUBES = 14
View Source
const REQUIRED_GREEN_CUBES = 13
View Source
const REQUIRED_RED_CUBES = 12

Variables

View Source
var BLUE_REGEX = regexp.MustCompile(`(\d+) blue`)
View Source
var GAME_REGEX = regexp.MustCompile(`Game (\d+): (.*)`)
View Source
var GREEN_REGEX = regexp.MustCompile(`(\d+) green`)
View Source
var RED_REGEX = regexp.MustCompile(`(\d+) red`)

Functions

func PowerCube

func PowerCube(cube SetCubes) int

Types

type Exercise

type Exercise struct{}

func (Exercise) Part1

func (e Exercise) Part1(path string) (int, error)

func (Exercise) Part2

func (e Exercise) Part2(path string) (int, error)

type SetCubes

type SetCubes struct {
	Red   int
	Green int
	Blue  int
}

func MinimumPowerSet

func MinimumPowerSet(cubes []SetCubes) SetCubes

func ParseGame

func ParseGame(input string) (int, []SetCubes)

Jump to

Keyboard shortcuts

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