go get github.com/ivanauliaa/more-strings
import morestrings "github.com/ivanauliaa/more-strings"
Functions
All of these functions are returning string
- Intersection(str1, str2 string)
- RemoveDups(str string)
func gemstones(arr []string) int32 {
result := morestrings.RemoveDups(arr[0])
for i := 1; i < len(arr); i++ {
temp := morestrings.RemoveDups(arr[i])
result = morestrings.Intersection(result, temp)
}
return int32(len(result))
}
Hackerrank: String Construction
func stringConstruction(s string) int32 {
return int32(len(RemoveDups(s)))
}