This is the code implementation of dupes check in a array.