v0.0.625
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m31s
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m31s
This commit is contained in:
@@ -631,3 +631,23 @@ func ArrShuffle[T any](arr []T) []T {
|
||||
|
||||
return arr
|
||||
}
|
||||
|
||||
func ArrMax[T NumberConstraint](first T, arr []T) T {
|
||||
res := first
|
||||
for _, v := range arr {
|
||||
if v > res {
|
||||
res = v
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func ArrMin[T NumberConstraint](first T, arr []T) T {
|
||||
res := first
|
||||
for _, v := range arr {
|
||||
if v < res {
|
||||
res = v
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user