Unique characters in each string: Difference between revisions

Content added Content deleted
(add PicoLisp)
Line 242: Line 242:
<pre>
<pre>
found 6 unique common characters: 123abc
found 6 unique common characters: 123abc
</pre>

=={{header|PicoLisp}}==
<lang PicoLisp>(de acc (V K N)
(if (assoc K (val V))
(inc (nth (cadr @) N))
(push V (list K (list 1 0 0))) ) )
(de un (Lst)
(let (Len (length Lst) D)
(for (I . Lst) (mapcar chop Lst)
(for L Lst
(acc 'D L I) ) )
(mapcar
car
(by
car
sort
(filter '((L) (fully =1 (cadr L))) D) ) ) ) )
(println
(un
(quote
"1a3c52debeffd"
"2b6178c97a938stf"
"3ycxdb1fgxa2yz" ) ) )</lang>
{{out}}
<pre>
("1" "2" "3" "a" "b" "c")
</pre>
</pre>