remove duplication item in []rune
(intSlice []rune)
| 201 | |
| 202 | // remove duplication item in []rune |
| 203 | func uniqueChar(intSlice []rune) []rune { |
| 204 | keys := make(map[rune]bool) |
| 205 | var list []rune |
| 206 | for _, entry := range intSlice { |
| 207 | if _, value := keys[entry]; !value { |
| 208 | keys[entry] = true |
| 209 | list = append(list, entry) |
| 210 | } |
| 211 | } |
| 212 | return list |
| 213 | } |
| 214 | |
| 215 | // check if all item in []int is equal, false for empty array |
| 216 | func allIntItemEqual(r []int) bool { |
no outgoing calls