Jump to content

Unique characters in each string: Difference between revisions

(Ada version)
Line 504:
done...
</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}}==
1,149

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.