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.
19 lines
255 B
19 lines
255 B
7 months ago
|
package cap3
|
||
|
|
||
|
type Pair struct {
|
||
|
first, second int
|
||
|
}
|
||
|
|
||
|
func Ex23(nums []int) [][]int {
|
||
|
countMap := _makeMatrix(10)
|
||
|
|
||
|
for _, num1 := range nums {
|
||
|
for _, num2 := range nums {
|
||
|
countMap[num1][num2]++
|
||
|
countMap[num2][num1]++
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return countMap
|
||
|
}
|