You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lavos/cap3/ex23.go

19 lines
300 B

7 months ago
package cap3
type Pair struct {
first, second int
7 months ago
}
func Ex23(nums []int) [][]int {
countMap := _makeMatrix(10)
7 months ago
for _, num1 := range nums {
for _, num2 := range nums {
countMap[num1][num2]++
countMap[num2][num1]++
}
}
7 months ago
return countMap
7 months ago
}