File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ std::unordered_map 底层实现为哈希,std::map 和std::multimap 的底层
95
95
96
96
本题咋眼一看好像和[ 18. 四数之] ( https://mp.weixin.qq.com/s/r5cgZFu0tv4grBAexdcd8A ) ,[ 15.三数之和] ( https://mp.weixin.qq.com/s/nQrcco8AZJV1pAOVjeIU_g ) 差不多,其实差很多!
97
97
98
- ** 关键差别是本题为四个独立的数组,只要找到A[ i] + B[ j] + C[ k] + D[ l] = 0就可以,不用考虑重复问题,而[ 18. 四数之 ] ( https://mp.weixin.qq.com/s/r5cgZFu0tv4grBAexdcd8A ) ,[ 15.三数之和] ( https://mp.weixin.qq.com/s/nQrcco8AZJV1pAOVjeIU_g ) 是一个数组(集合)里找到和为0的组合,可就难很多了!**
98
+ ** 关键差别是本题为四个独立的数组,只要找到A[ i] + B[ j] + C[ k] + D[ l] = 0就可以,不用考虑重复问题,而[ 18. 四数之和 ] ( https://mp.weixin.qq.com/s/nQrcco8AZJV1pAOVjeIU_g ) ,[ 15.三数之和] ( https://mp.weixin.qq.com/s/r5cgZFu0tv4grBAexdcd8A ) 是一个数组(集合)里找到和为0的组合,可就难很多了!**
99
99
100
100
用哈希法解决了两数之和,很多同学会感觉用哈希法也可以解决三数之和,四数之和。
101
101
You can’t perform that action at this time.
0 commit comments