📜  go count distinct elements in list - Go 编程语言 - Go 编程语言代码示例
📅  最后修改于: 2022-03-11 14:45:02.703000             🧑  作者: Mango
代码示例1
distinct := make(map[T]bool)
for _, v := range items {
distinct[v] = true
}
cnt := len(distinct)