Multiset is a threadsafe abstract data structure library for representing collection of distinct values, without any particular order. Unlike a set, multiset allows multiple instances for each of its elements.
package main
import (
"fmt"
"github.com/trivigy/multiset"
)
func main() {
m := multiset.New("b", "b", "c", "d")
fmt.Println(m.Contains("b", "c", "d"))
m1 := multiset.New()
m1.AddCount("a", 3)
m1.AddCount("b", 2)
fmt.Println(m1.DistinctElements())
}