1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

feat: add SymmetricDifference func for set

This commit is contained in:
dudaodong
2022-04-01 18:06:34 +08:00
parent 3c16d50c4b
commit c51a806aff

View File

@@ -104,7 +104,7 @@ func (s Set[T]) Intersection(other Set[T]) Set[T] {
return set
}
// SymmetricDifference creates a new set whose element both be contained in set s and other
// SymmetricDifference creates a new set whose element is in set1 or set2, but not in both sets
func (s Set[T]) SymmetricDifference(other Set[T]) Set[T] {
set := NewSet[T]()
s.Iterate(func(value T) {