Unique characters in each string: Difference between revisions
m
Python example
(→{{header|AppleScript}}: Specified the selector for the sort descriptor. Added a solution using only core AppleScript.) |
m (Python example) |
||
Line 166:
<pre>
found 6 unique common characters: 123abc
</pre>
=={{header|Python}}==
<lang python>list = ["1a3c52debeffd", "2b6178c97a938stf", "3ycxdb1fgxa2yz"]
print(sorted([ch for ch in set([c for c in ''.join(list)]) if all(w.count(ch) == 1 for w in list)]))
</lang>{{out}}
<pre>
['1', '2', '3', 'a', 'b', 'c']
</pre>
|