📅  最后修改于: 2022-03-11 15:00:58.060000             🧑  作者: Mango
extension Array where Element: Hashable {
func difference(from other: [Element]) -> [Element] {
let thisSet = Set(self)
let otherSet = Set(other)
return Array(thisSet.symmetricDifference(otherSet))
}
}