aoc24

package
v0.0.0-...-8a9fc9a Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsDiff

func AbsDiff[I Integer](x, y I) I

func AddSolution

func AddSolution[I any, O1 any, O2 any](day int, parse func(string) (I, error), part1 func(I) (O1, error), part2 func(I) (O2, error))

func AllFunc

func AllFunc[T any](inputs []T, f func(T) bool) bool

func AnyFunc

func AnyFunc[T any](inputs []T, f func(T) bool) bool

func AssertEqual

func AssertEqual[T comparable](t *testing.T, actual T, expected T)

func AssertSliceEqual

func AssertSliceEqual[T comparable](t *testing.T, actual []T, expected []T)

func CopyAdd

func CopyAdd[K comparable, V any](m map[K]V, k K, v V) map[K]V

func CopyAppend

func CopyAppend[T any](sl []T, pos T) []T

func CopyMap

func CopyMap[K comparable, V any](m map[K]V) map[K]V

func CountTrueFunc

func CountTrueFunc[T any](inputs []T, f func(T) bool) int

func GCD

func GCD(a int, b int) int

func GetInput

func GetInput(day int) (string, error)

func PopMap

func PopMap[K comparable, V any](m map[K]V) (K, V)

func Solve

func Solve[I any, O1 any, O2 any](input_string string, parse func(string) (I, error), part1 func(I) (O1, error), part2 func(I) (O2, error)) error

func SolveDay

func SolveDay(day int, input string) error

func Sum

func Sum[V Number](values []V) V

func SumFunc

func SumFunc[T any, V Number](inputs []T, f func(T) V) V

Types

type Integer

type Integer interface {
	int | int8 | int16 | int32 | int64
}

type Number

type Number interface {
	int | float32 | float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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