exerr [WIP]

This commit is contained in:
2023-02-15 16:04:19 +01:00
parent 17383894a7
commit c0443af63b
10 changed files with 579 additions and 12 deletions

View File

@@ -282,3 +282,11 @@ func ArrSum[T NumberConstraint](arr []T) T {
}
return r
}
func ArrRemove[T comparable](arr []T, needle T) []T {
idx := ArrFirstIndex(arr, needle)
if idx >= 0 {
return append(arr[:idx], arr[idx+1:]...)
}
return arr
}