Find Duplicate Elements In Array Using Swift
To find duplicates, you could build cross reference by phone number, then filter that down to duplicates only. For example, consider: let contacts = [ Contact(name: “Rob”, phone: “555-1111”), Contact(name: “Richard”, phone: “555-2222”), Contact(name: “Rachel”, phone: “555-1111”), Contact(name: “Loren”, phone: “555-2222”), Contact(name: “Mary”, phone: “555-3333”), Contact(name: “Susie”, phone: “555-2222”) ] You can build the cross … Read more