added duplicate checking function
added duplicate checking function
added duplicates checking problem