2023-10-19发表2023-10-19更新LeetCode每日一题几秒读完 (大约95个字)0次访问1726. 同积元组1726. 同积元组 难度: medium 原始链接: https://leetcode.cn/problems/tuple-with-same-product 标签: 哈希, 数学 解法一: 哈希, 数学go1234567891011121314func tupleSameProduct(nums []int) int { mulMap := make(map[int]int) length := len(nums) for i := 0; i < length; i++ { for j := i + 1; j < length; j++ { mulMap[nums[i] * nums[j]]++ } } ans := 0 for _, count := range mulMap { ans += count * (count - 1) * 4 } return ans} 1726. 同积元组https://wuhunyu.top/leetcode/2023/11/tuple-with-same-product/index.html作者wuhunyu发布于2023-10-19更新于2023-10-19许可协议#数学哈希