Magenic Interview Question

Write a function to remove duplicates from an array.