utils

package
v0.0.0-...-291aae9 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MaxInt = int(^uint(0) >> 1)
View Source
const MinInt = ^MaxInt

Variables

This section is empty.

Functions

func Abs

func Abs[T constraints.Signed](x T) T

func CharToLower

func CharToLower(c byte) byte

func CharToUpper

func CharToUpper(c byte) byte

func Contains

func Contains(haystack []string, needle string) bool

func Gcd

func Gcd(x, y int) int

func MapFindMax

func MapFindMax(m interface{}) interface{}

Returns key from map[T]int which has the max value

func MapFindMin

func MapFindMin(m interface{}) interface{}

Returns key from map[T]int which has the min value

func Max

func Max[T constraints.Ordered](a, b T) T

func Min

func Min[T constraints.Ordered](a, b T) T

func MustAtoi

func MustAtoi(s string) int

func MustParseToStruct

func MustParseToStruct(re *regexp.Regexp, input string, target interface{})

func PanicOnErr

func PanicOnErr(err error)

func ParseToStruct

func ParseToStruct(re *regexp.Regexp, input string, target interface{}) bool

func Readfile

func Readfile(day int) string

func Sign

func Sign[T constraints.Signed](x T) int

func SliceMinMax

func SliceMinMax[T constraints.Ordered](slice []T) (*T, *T)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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