Answers for "get difference between two arrays swift"

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 "get difference between two arrays swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language