Swift 1 line solution


  • 1
    T
    class Solution {
      func intersection(nums1: [Int], _ nums2: [Int]) -> [Int] {
        return [Int](Set<Int>(nums1).intersect(nums2))
      }
    }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.