Use a more efficient method to remove duplicate elements.
Correct a silly calculation mistake in the comments.