Amazon Interview Question

remove duplications in an array