Removed function that wasn't being used in 'greg', moved to 'main'

This commit is contained in:
2025-01-30 08:58:43 -05:00
parent c06d81d17d
commit ee6bb3959c
2 changed files with 14 additions and 11 deletions

View File

@@ -0,0 +1,14 @@
package main
import "slices"
// Returns all elements in slice A that are NOT in slice B
func setDifference[T comparable](s1 []T, s2 []T) []T {
toReturn := make([]T, 0, len(s1))
for _, val := range s1 {
if !slices.Contains(s2, val) {
toReturn = append(toReturn, val)
}
}
return toReturn
}