
removeDuplicateCharacters
Remove all characters from a given string that appear more than once in it.
Example
- For
str = "zaabcbd"
, the output should beremoveDuplicateCharacters(str) = "zcd"
.
Input/Output
-
[execution time limit] 3 seconds
-
[input] string str
A string consisting of lower-case letters (
a...z
).Guaranteed constraints:
2 ≤ str.length ≤ 100
. -
[output] string
Initial string where all characters appearing more than once are deleted.
Post Comment