checks for a given string, whether it contains any duplicate characters