mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-05-18 19:13:27 +02:00
13 lines
222 B
Go
13 lines
222 B
Go
package util
|
|
|
|
// MaxInts takes a variable number of integers and returns the largest one
|
|
func MaxInts(nums ...int) int {
|
|
maxNum := nums[0]
|
|
for _, v := range nums {
|
|
if v > maxNum {
|
|
maxNum = v
|
|
}
|
|
}
|
|
return maxNum
|
|
}
|