Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[pull] main from itcharge:main #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pull merged 1 commit into AlgorithmAndLeetCode:main from itcharge:main
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ while left_1 < len(nums1) and left_2 < len(nums2):
1. 对数组 `nums1`、`nums2` 先排序。
2. 使用两个指针 `left_1`、`left_2`。`left_1` 指向第一个数组的第一个元素,即:`left_1 = 0`,`left_2` 指向第二个数组的第一个元素,即:`left_2 = 0`。
3. 如果 `nums1[left_1]` 等于 `nums2[left_2]`,则将其加入答案数组(注意去重),并将 `left_1` 和 `left_2` 右移。
4. 如果 `nums1[left_2]` 小于 `nums2[left_2]`,则将 `left_1` 右移。
5. 如果 `nums1[left_2]` 大于 `nums2[left_2]`,则将 `left_2` 右移。
4. 如果 `nums1[left_1]` 小于 `nums2[left_2]`,则将 `left_1` 右移。
5. 如果 `nums1[left_1]` 大于 `nums2[left_2]`,则将 `left_2` 右移。
6. 最后输出答案数组。

##### 思路 1:代码
Expand Down
4 changes: 2 additions & 2 deletions Solutions/0349. 两个数组的交集.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class Solution:
1. 对数组 `nums1`、`nums2` 先排序。
2. 使用两个指针 `left_1`、`left_2`。`left_1` 指向第一个数组的第一个元素,即:`left_1 = 0`,`left_2` 指向第二个数组的第一个元素,即:`left_2 = 0`。
3. 如果 `nums1[left_1]` 等于 `nums2[left_2]`,则将其加入答案数组(注意去重),并将 `left_1` 和 `left_2` 右移。
4. 如果 `nums1[left_2]` 小于 `nums2[left_2]`,则将 `left_1` 右移。
5. 如果 `nums1[left_2]` 大于 `nums2[left_2]`,则将 `left_2` 右移。
4. 如果 `nums1[left_1]` 小于 `nums2[left_2]`,则将 `left_1` 右移。
5. 如果 `nums1[left_1]` 大于 `nums2[left_2]`,则将 `left_2` 右移。
6. 最后输出答案数组。

### 思路 2:代码
Expand Down

AltStyle によって変換されたページ (->オリジナル) /