I came up with three different solutions, presented in Python 3.

First I tried the most obvious solution: Memorize all seen characters and fire False whenever you encounter the same character again.

Problem: Additional list do administer.

Next solution: Just split the string in all its characters and remove duplicates. set() is doing this for us, and so in the end it comes down to compare the length of the original string with the set of unique characters.

Problem: Highly abstract method set is doing all the job and an additional data structure

Next solution: Dont use any additional variables or data structures. Only work with the string presented: So I solved the task by a look forward search: Take the current character and look through the rest of the string if this character is used again. Simple and neat.

Problem: Still not feeling as the best solution, because we have to iterate every character AND for each character over the rest of the string. Maybe we can break it down to only one operation per character? Yes

Final Solution: Try to find out how many characters are there by simple cutting it out. So we replace character c with '' and compare the length of before and after. This tells us exactly when there is a duplicate.

An alternative to the last approach is to sort the string and just compare two directly following characters. But you have the cost for sorting.

Programmed with a static helper class and some test cases. Just replace method1 with method2 or method3 in the isUnique() method. Or even better, use all 3 of them and compare results.

However, very much is unclear in this challenge, therefore I did not assume anything unstated:

- What about case sensitivity? Is "a" a duplicate of "A"?
- What about special characters like punctuation?
- What about whitespace? Is "what a nice day" the same as "Whataniceday"?

Though it would be easy to treat each of these, it was not stated and so it was not covered in my solution.

```
class stringTester:
@staticmethod
def method1(s):
tmpLetters = []
for c in s:
if not c in tmpLetters:
tmpLetters.append(c)
else:
return False
return True
@staticmethod
def method2(s):
if (len(s) == len(set(s))):
return True
else:
return False
@staticmethod
def method3(s):
for i, c in enumerate(s):
if s.count(c, i+1) > 0:
#print("Test for {0} in {1}".format(c, s[i+1:]))
return False
return True
@staticmethod
def method4(s):
for c in s:
if (len(s.replace(c, '')) != len(s) -1):
return False
return True
@staticmethod
def isUnique(s):
# should be all true or all false
results = [
stringTester.method1(s),
stringTester.method2(s),
stringTester.method3(s),
stringTester.method4(s)
]
assert(all(results) or not any(results))
if all(results):
return "all unique"
else:
return "duplicates found"
def test():
testStrings = [
("we are all lost!", "duplicates found"),
("What nice cloud", "duplicates found"),
("abcdefghijklmnopqrstuvwxyzß", "all unique"),
("Someday I come for you", "duplicates found"),
("IDUnique", "all unique"),
("ABJDjk", "all unique"),
("ABC", "all unique"),
("Whatnicedog", "all unique"),
(".,-!?()=[]&%$§", "all unique"),
("42", "all unique"),
("population", "duplicates found"),
("ABCabc", "all unique")
]
for s,t in testStrings:
assert(stringTester.isUnique(s) == t)
test()
```