Skip to content

Commit

Permalink
🎉auto update by Gmeek action
Browse files Browse the repository at this point in the history
  • Loading branch information
bg6mgd committed Dec 6, 2024
1 parent abeabe2 commit af5c278
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h1 class="postTitle">2024年9月14日在列表中找到两个数的和等于某
</div>
<div id="content">
<div class="markdown-body" id="postBody"><div class="highlight highlight-source-python"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Solution</span>:
<span class="pl-k">def</span> <span class="pl-en">twoSum</span>(<span class="pl-s1">self</span>, <span class="pl-s1">nums</span>: <span class="pl-v">List</span>[<span class="pl-s1">int</span>], <span class="pl-s1">target</span>: <span class="pl-s1">int</span>) <span class="pl-c1">-&gt;</span> <span class="pl-v">List</span>[<span class="pl-s1">int</span>]:
<span class="pl-k">def</span> <span class="pl-en">twoSum</span>(<span class="pl-s1">self</span>, <span class="pl-s1">nums</span>: <span class="pl-v">List</span>[<span class="pl-smi">int</span>], <span class="pl-s1">target</span>: <span class="pl-smi">int</span>) <span class="pl-c1">-&gt;</span> <span class="pl-v">List</span>[<span class="pl-smi">int</span>]:
<span class="pl-s1">hash_map</span> <span class="pl-c1">=</span> {}
<span class="pl-k">for</span> <span class="pl-s1">i</span>, <span class="pl-s1">num</span> <span class="pl-c1">in</span> <span class="pl-en">enumerate</span>(<span class="pl-s1">nums</span>):
<span class="pl-s1">complement</span> <span class="pl-c1">=</span> <span class="pl-s1">target</span> <span class="pl-c1">-</span> <span class="pl-s1">num</span> <span class="pl-c"># 计算目标值需要的差值</span>
Expand Down

0 comments on commit af5c278

Please sign in to comment.