2 ms·
I've already provided a link in a previous comment which has several algos and discussed the tradeoffs. I've also outlined the issue with the one you presented
by verdverm 4y ago
I've already provided a link in a previous comment which has several algos and discussed the tradeoffs. I've also outlined the issue with the one you presented in the post. Perhaps reviewing the thread would be a useful activity?
https://www.rosettacode.org/wiki/Remove_duplicate_elements https://www.rosettacode.org/wiki/Remove_duplicate_elements