utils

package
v0.0.0-...-973409f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GCD

func GCD(a, b int) int

GCD greatest common divisor (GCD) via Euclidean algorithm

func LCM

func LCM(a, b int, integers ...int) int

LCM find Least Common Multiple (LCM) via GCD

func MinInt

func MinInt(ints ...int) int

func ParseNumsRow

func ParseNumsRow(input string) []int

func Permutations

func Permutations(arr []int) [][]int

func RemoveElementByIndex

func RemoveElementByIndex(s []int, i int) []int

func RemoveElementByIndexInplace

func RemoveElementByIndexInplace(s []int, i int) []int

func ReverseString

func ReverseString(s string) string

func SliceInt

func SliceInt(v int) []int8

SliceInt returns a list of digits of a given integer

SliceInt(123456) => []int8{1,2,3,4,5}

func SplitIntRange

func SplitIntRange(from int, to int, n int) [][]int

SplitIntRange splits range into n sequential ranges

func SumIntSlice

func SumIntSlice(s []int) (sum int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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