Remove duplicates in-place from unsorted array | Microsoft Interview Question