Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
(def items [1 2 3 4 4 5 5 5])
(def c (count (set items)))
var c = items.toSet().length;
c = items |> Enum.uniq |> length
func count[T comparable](items []T) int {
distinct := make(map[T]bool)
for _, v := range items {
distinct[v] = true
}
return len(distinct)
}
distinct := make(map[T]bool)
for _, v := range items {
distinct[v] = true
}
c := len(distinct)
const c = new Set(items).size;
long c = items.stream().distinct().count();
val c = items.distinct().size
local c=#items
$c = count(array_unique($items));
c = len(set(items))
c = items.uniq.count