pkg

package
v0.0.0-...-145ca25 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(i int) int

func Check

func Check(err error)

func Combinations

func Combinations[T any](set []T, n int) (subsets [][]T)

func CreateSlice

func CreateSlice[T any](len int, defaultValue T) []T

func GCD

func GCD(a, b int) int

func GetChar

func GetChar(str string, index int) rune

func IntPow

func IntPow(n, m int) int

func IntersectHash

func IntersectHash[T comparable](a []T, b []T) []T

func IntersectSorted

func IntersectSorted[T comparable](a []T, b []T) []T

func IsInteger

func IsInteger(num float64) bool

func IsSameElement

func IsSameElement[T comparable](slice []T) bool

func LCM

func LCM(a, b int) int

func LcmAll

func LcmAll(a int, bs ...int) int

func MapContains

func MapContains[T, M comparable](m map[T]M, value M) bool

func MapCountOccurrences

func MapCountOccurrences[T, M comparable](m map[T]M, value M) int

func Max

func Max(values ...int) int

func Min

func Min(values ...int) int

func Multiply

func Multiply(values ...int) int

func MustAtoi

func MustAtoi(s string) int

func MustScanf

func MustScanf(line, format string, a ...interface{})

func ParseIntList

func ParseIntList(s, sep string) []int

func ParseIntMap

func ParseIntMap(s, sep string) map[int]int

func Reduce

func Reduce[T, M any](s []T, f func(M, T) M, initValue M) M

func ReplaceAllStringSubmatchFunc

func ReplaceAllStringSubmatchFunc(re *regexp.Regexp, str string, repl func([]string) string) string

func SanitizeIndex

func SanitizeIndex(index int, maxIndex int) int

func SetContainsAll

func SetContainsAll[T, M comparable](set map[T]M, key ...T) bool

func StandardizeSpaces

func StandardizeSpaces(s string) string

func Sum

func Sum(values ...int) int

func TransposeMatrix

func TransposeMatrix[T any](slice [][]T) [][]T

func UintPow

func UintPow(n, m uint64) uint64

func Zip

func Zip[T, U any](t []T, u []U) iter.Seq2[T, U]

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