167. Intersection of unsorted arrays

JavaScriptAlgorithm

easy  - accepted / - tried

Given two arrays, find the intersection(items occur in both arrays)

  1. arrays are not sorted, and might have duplicates.
  2. you can modify the arrays
  3. you can return the items in any order, but without duplicates.

This is an easy problem, What is the time & space complexity of your approach?

Bugfree ordinary solution is better than buggy fancy ones.