And now with a meaningful name. Because, what does duplicateCheck mean, that is has, or does not have duplicates. For the boolean version hasDuplicates would be the better name.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Shorter and more useful since it returns the number of duplicates
And now with a meaningful name. Because, what does
duplicateCheckmean, that is has, or does not have duplicates. For the boolean versionhasDuplicateswould be the better name.