arrays

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sum

func Sum(numbers []int) int

Receiving array of integers and returns those sum

Example
sum := Sum([]int{1, 2, 3, 4})
fmt.Print(sum)
Output:
10

func SumAll

func SumAll(numbersToSum ...[]int) []int

Receiving multiple arrays of integers and returning a slice of sums for each array

Example
sums := SumAll([]int{3, 4, 5}, []int{5, 6, 7})
fmt.Print(sums)
Output:
[12 18]

func SumAllTails

func SumAllTails(numbersToSum ...[]int) []int
Example
sumsTails := SumAllTails([]int{3, 4, 5}, []int{5, 6, 7})
fmt.Print(sumsTails)
Output:
[9 13]

Types

This section is empty.

Jump to

Keyboard shortcuts

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