wangjunstf / wangjunstf.github.io

我的博客。

Home Page:https://wangjunstf.github.io/

Repository from Github https://github.comwangjunstf/wangjunstf.github.ioRepository from Github https://github.comwangjunstf/wangjunstf.github.io

【算法解析】巧用哈希表与组合公式:高效统计数组中相同数对的数量 | 编程之禅

wangjunstf opened this issue · comments

https://wangjunstf.github.io/2025/09/18/qiao-yong-ha-xi-biao-yu-zu-he-gong-shi-gao-xiao-tong-ji-shu-zu-zhong-xiang-tong-shu-dui-de-shu-liang/

现有以下题目:1512. 好数对的数目 现有一个整数数组,要求统计数组中满足条件的索引对 (i, j)(其中 i < j 且 nums[i] = nums[j])数量。

哈希表