Answers for "difference between two array 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 "difference between two array swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language