Unique characters: Difference between revisions
Content added Content deleted
(→{{header|Python}}: Added a solution in Python) |
|||
Line 797: | Line 797: | ||
# uniques :: [String] -> [Char] |
# uniques :: [String] -> [Char] |
||
def uniques( |
def uniques(xs): |
||
'''Characters which occur only once |
'''Characters which occur only once |
||
across the given strings. |
across the list of given strings. |
||
''' |
''' |
||
return [ |
return [ |
||
k for k, g in |
k for k, g in |
||
groupby(sorted(chain(* |
groupby(sorted(chain(*xs))) |
||
if 1 == len(list(g)) |
if 1 == len(list(g)) |
||
] |
] |