66. remove duplicates from an array


medium  - accepted / - tried

Given an array containing all kinds of data, please implement a function deduplicate() to remove the duplicates.

You should modify the array in place. Order doesn't matter.

What is time & space cost of your approach?

Let's try to solve this problem within 10 minutes.