1

I have a multidimensional array in swift like this:

arr = [[1,2],[1,2],[3,4],[3,4],[4,5]]

How do I remove duplicates from this array so that my final array is:

[[1,2],[3,4],[4,5]]

I'm a swift newbie. I know I can write a function to remove the dupes, but I wanted to know if there was a way to do this directly.

smokinguns
  • 699
  • 2
  • 10
  • 24
  • `let filteredArray = Array(NSSet(array: array as NSArray as! [NSObject])) ` from this answer --> https://stackoverflow.com/a/42921829/4475605 – Adrian Mar 20 '18 at 20:39

0 Answers0