#MATLAB, 23#
MATLAB, 23
@(n)union(n,n,'stable')
Does the "set union" of the input string with itself, using the 'stable' method which does not sort, and then prints.
This works because union
returns only non-duplicate values after the merge. So essentially if you union
the string with itself, it first produces a string like Type unique chars!Type unique chars!
, and then removes all duplicates without sorting.
No need for unique
:)