Unique characters: Difference between revisions
Content added Content deleted
(→{{header|Ruby}}: Add Ruby) |
|||
Line 1,457: | Line 1,457: | ||
</pre> |
</pre> |
||
=={{header|Ruby}}== |
|||
<syntaxhighlight lang="ruby">words = ["133252abcdeeffd", "a6789798st", "yxcdfgxcyz"] |
|||
counter = words.inject({}){|h, word| word.chars.tally(h)} |
|||
puts counter.filter_map{|char, count| char if count == 1}.sort.join |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
156bgstz |
|||
</pre> |
|||
=={{header|Transd}}== |
=={{header|Transd}}== |
||
<syntaxhighlight lang="Scheme">#lang transd |
<syntaxhighlight lang="Scheme">#lang transd |