Unique characters in each string: Difference between revisions
Content added Content deleted
(Ada version) |
(→{{header|Ruby}}: Add Ruby) |
||
Line 504: | Line 504: | ||
done... |
done... |
||
</pre> |
</pre> |
||
=={{header|Ruby}}== |
|||
<lang ruby>arr = ["1a3c52debeffd", "2b6178c97a938stf", "3ycxdb1fgxa2yz"] |
|||
uniqs_in_str = arr.map{|str| str.chars.tally.filter_map{|k, v| k if v == 1} } |
|||
puts uniqs_in_str.inject(&:intersection).sort.join(" ") |
|||
</lang> |
|||
{{out}} |
|||
<pre>1 2 3 a b c</pre> |
|||
=={{header|Wren}}== |
=={{header|Wren}}== |