The simplest approach is to check every element against the remaining elements. If I find the same number again, it’s a duplicate. To avoid adding the same duplicate more than once, I can maintain a ...