Answers for "swift extract differences between two arrays"

0

swift find difference between two arrays

extension Array where Element: Hashable {
    func difference(from other: [Element]) -> [Element] {
        let thisSet = Set(self)
        let otherSet = Set(other)
        return Array(thisSet.symmetricDifference(otherSet))
    }
}
Posted by: Guest on November-27-2020

Code answers related to "swift extract differences between two arrays"

Code answers related to "Swift"

Browse Popular Code Answers by Language