util

package
v0.0.0-...-30497a8 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(v int) int

Abs returns the absolute value of x.

func AtoiNoError

func AtoiNoError(s string) int

AtoiNoError calls `strconv.Atoi`, but assumes input `s` is a valid integer

func GCD

func GCD(a, b int) int

func LCM

func LCM(a, b int) int

func Map

func Map[T any, R any](x []T, mapFunc func(T) R) []R

func Max

func Max(x int, y int) int

Max returns the larger of x or y.

func Min

func Min(x int, y int) int

Min returns the smaller of x or y.

func Normalize

func Normalize(x int) int

func Pow

func Pow(x, y int) int

Pow returns x**y, the base-x exponential of y.

func ReadProblemInput

func ReadProblemInput(fileCollection embed.FS) []string

ReadProblemInput reads and returns data from the file named "input.txt" from the `fileCollection`

Types

This section is empty.

Jump to

Keyboard shortcuts

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