go count distinct elements in list code example
Example: go count distinct elements in list
distinct := make(map[T]bool)
for _, v := range items {
distinct[v] = true
}
cnt := len(distinct)
distinct := make(map[T]bool)
for _, v := range items {
distinct[v] = true
}
cnt := len(distinct)