Implement in-place duplicate removal | Meta Interview Question