Unique characters: Difference between revisions

Content added Content deleted
No edit summary
Line 1,353: Line 1,353:
Found 8 unique characters
Found 8 unique characters
done...
done...
</pre>

=={{header|Vlang}}==
<lang vlang>fn main() {
strings := ["133252abcdeeffd", "a6789798st", "yxcdfgxcyz"]
mut m := map[rune]int{}
for s in strings {
for c in s {
m[c]++
}
}
mut chars := []rune{}
for k, v in m {
if v == 1 {
chars << k
}
}
chars.sort_with_compare(fn(i &rune, j &rune) int {
if *i<*j {
return -1
}
if *i>*j {
return 1
}
return 0
})
println(chars.string())
}</lang>

{{out}}
<pre>
156bgstz
</pre>
</pre>