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

add 80 & 81 #13

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
cy69855522 merged 1 commit into cy69855522:master from Lebhoryi:master
Mar 9, 2020
Merged
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
17 changes: 17 additions & 0 deletions README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,23 @@ class Solution:
from itertools import combinations
return sum([list(combinations(nums, i)) for i in range(len(nums) + 1)], [])
```

## [80. 删除排序数组中的重复项 II 4行](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array-ii/)
```python
def removeDuplicates(nums: [int]) -> int:
for i in range(len(nums)-3, -1, -1):
if nums[i] == nums[i+1] and nums[i] == nums[i+2]:
nums.pop(i)
return len(nums)
```
- 从尾部开始考虑

## [81. 搜索旋转排序数组 II 1行](https://leetcode-cn.com/problems/search-in-rotated-sorted-array-ii/)
```python
def search(nums: [int], target: int) -> bool:
return target in nums
```

## [83. Remove Duplicates from Sorted List 3行](https://leetcode.com/problems/remove-duplicates-from-sorted-list/)
```python
# Definition for singly-linked list.
Expand Down

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