mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-30 03:47:14 +00:00
build
This commit is contained in:
@@ -14,7 +14,7 @@ comments: true
|
||||
|
||||
考虑直接遍历所有可能的组合。如图 10-9 所示,我们开启一个两层循环,在每轮中判断两个整数的和是否为 `target` ,若是则返回它们的索引。
|
||||
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 10-9 线性查找求解两数之和 </p>
|
||||
|
||||
@@ -237,13 +237,13 @@ comments: true
|
||||
2. 将键值对 `nums[i]` 和索引 `i` 添加进哈希表。
|
||||
|
||||
=== "<1>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "<2>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "<3>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 10-10 辅助哈希表求解两数之和 </p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user