intslice

package
v0.43.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 1 Imported by: 3

Documentation

Overview

Package intslice provides a few helper functions for dealing with []int.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Common added in v0.39.0

func Common(a, b []int) []int

func Contains

func Contains(list []int, a int) bool

Contains checks if an int is in a []int, returns bool.

func ContainsDuplicates added in v0.42.0

func ContainsDuplicates(a []int) bool

func CreateContinuousIntSlice added in v0.42.0

func CreateContinuousIntSlice(start, end int) []int

func Difference added in v0.39.0

func Difference(a, b []int) []int

func IsContinuous added in v0.42.0

func IsContinuous(list []int) bool

IsContinuous checks if an int slice contains a continuous list of incremental integers

func Max added in v0.18.2

func Max(list []int) int

Max for a non-empty int slice.

func Min added in v0.18.2

func Min(list []int) int

Min for a non-empty int slice.

func NotCommon added in v0.39.0

func NotCommon(a, b []int) []int

func RemoveDuplicates added in v0.39.2

func RemoveDuplicates(options *[]int, otherStringsToClean ...int)

RemoveDuplicates in []int.

func RemoveDuplicates64 added in v0.42.0

func RemoveDuplicates64(options *[]int64, otherStringsToClean ...int64)

RemoveDuplicates64 in []int64.

func Sum added in v0.31.0

func Sum(list []int) int

Sum of the contents of an []int.

func ToStringSlice

func ToStringSlice(in []int) []string

ToStringSlice transforms an []int to a []string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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