Skip to content

Commit 0603fe4

Browse files
authored
chore: remove unnecessary import statements (#3958)
1 parent d423cc1 commit 0603fe4

File tree

162 files changed

+64
-543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+64
-543
lines changed

lcof2/剑指 Offer II 057. 值和下标之差都在给定的范围内/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
6969
#### Python3
7070

7171
```python
72-
from sortedcontainers import SortedSet
73-
74-
7572
class Solution:
7673
def containsNearbyAlmostDuplicate(self, nums: List[int], k: int, t: int) -> bool:
7774
s = SortedSet()

lcof2/剑指 Offer II 057. 值和下标之差都在给定的范围内/Solution.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedSet
2-
3-
41
class Solution:
52
def containsNearbyAlmostDuplicate(self, nums: List[int], k: int, t: int) -> bool:
63
s = SortedSet()

lcof2/剑指 Offer II 058. 日程表/README.md

-6
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ MyCalendar.book(20, 30); // returns true ,第三个日程安排可以添加到
6565
#### Python3
6666

6767
```python
68-
from sortedcontainers import SortedDict
69-
70-
7168
class MyCalendar:
7269
def __init__(self):
7370
self.sd = SortedDict()
@@ -89,9 +86,6 @@ class MyCalendar:
8986
#### Java
9087

9188
```java
92-
import java.util.Map;
93-
import java.util.TreeMap;
94-
9589
class MyCalendar {
9690

9791
private final TreeMap<Integer, Integer> tm = new TreeMap<>();

lcof2/剑指 Offer II 058. 日程表/Solution.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import java.util.Map;
2-
import java.util.TreeMap;
3-
41
class MyCalendar {
52

63
private final TreeMap<Integer, Integer> tm = new TreeMap<>();
@@ -25,4 +22,4 @@ public boolean book(int start, int end) {
2522
/**
2623
* Your MyCalendar object will be instantiated and called as such: MyCalendar
2724
* obj = new MyCalendar(); boolean param_1 = obj.book(start,end);
28-
*/
25+
*/

lcof2/剑指 Offer II 058. 日程表/Solution.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedDict
2-
3-
41
class MyCalendar:
52
def __init__(self):
63
self.sd = SortedDict()

lcp/LCP 24. 数字游戏/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,6 @@ class Solution {
403403
#### Python3
404404

405405
```python
406-
from sortedcontainers import SortedList
407-
408-
409406
class Solution:
410407
def numsGame(self, nums: List[int]) -> List[int]:
411408
l = SortedList()

lcp/LCP 24. 数字游戏/Solution2.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedList
2-
3-
41
class Solution:
52
def numsGame(self, nums: List[int]) -> List[int]:
63
l = SortedList()

lcp/LCP 52. 二叉搜索树染色/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2052.%20%E4%BA%8C%
8989
# self.left = None
9090
# self.right = None
9191

92-
from sortedcontainers import SortedList
93-
94-
9592
class Solution:
9693
def getNumber(self, root: Optional[TreeNode], ops: List[List[int]]) -> int:
9794
def dfs(root):

lcp/LCP 52. 二叉搜索树染色/Solution.py

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
# self.left = None
66
# self.right = None
77

8-
from sortedcontainers import SortedList
9-
108

119
class Solution:
1210
def getNumber(self, root: Optional[TreeNode], ops: List[List[int]]) -> int:

solution/0200-0299/0220.Contains Duplicate III/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ abs(nums[i] - nums[j]) &lt;= valueDiff --&gt; abs(1 - 1) &lt;= 0
8484
#### Python3
8585

8686
```python
87-
from sortedcontainers import SortedSet
88-
89-
9087
class Solution:
9188
def containsNearbyAlmostDuplicate(
9289
self, nums: List[int], indexDiff: int, valueDiff: int

solution/0200-0299/0220.Contains Duplicate III/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ The time complexity is $O(n \times \log k)$, where $n$ is the length of the arra
8282
#### Python3
8383

8484
```python
85-
from sortedcontainers import SortedSet
86-
87-
8885
class Solution:
8986
def containsNearbyAlmostDuplicate(
9087
self, nums: List[int], indexDiff: int, valueDiff: int

solution/0200-0299/0220.Contains Duplicate III/Solution.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedSet
2-
3-
41
class Solution:
52
def containsNearbyAlmostDuplicate(
63
self, nums: List[int], indexDiff: int, valueDiff: int

solution/0200-0299/0225.Implement Stack using Queues/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ class MyStack:
126126
#### Java
127127

128128
```java
129-
import java.util.Deque;
130-
131129
class MyStack {
132130
private Deque<Integer> q1 = new ArrayDeque<>();
133131
private Deque<Integer> q2 = new ArrayDeque<>();

solution/0200-0299/0225.Implement Stack using Queues/README_EN.md

-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ class MyStack:
121121
#### Java
122122

123123
```java
124-
import java.util.Deque;
125-
126124
class MyStack {
127125
private Deque<Integer> q1 = new ArrayDeque<>();
128126
private Deque<Integer> q2 = new ArrayDeque<>();

solution/0200-0299/0225.Implement Stack using Queues/Solution.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import java.util.Deque;
2-
31
class MyStack {
42
private Deque<Integer> q1 = new ArrayDeque<>();
53
private Deque<Integer> q2 = new ArrayDeque<>();
@@ -37,4 +35,4 @@ public boolean empty() {
3735
* int param_2 = obj.pop();
3836
* int param_3 = obj.top();
3937
* boolean param_4 = obj.empty();
40-
*/
38+
*/

solution/0300-0399/0352.Data Stream as Disjoint Intervals/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ summaryRanges.getIntervals(); // 返回 [[1, 3], [6, 7]]
8383
#### Python3
8484

8585
```python
86-
from sortedcontainers import SortedDict
87-
88-
8986
class SummaryRanges:
9087
def __init__(self):
9188
self.mp = SortedDict()

solution/0300-0399/0352.Data Stream as Disjoint Intervals/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ summaryRanges.getIntervals(); // return [[1, 3], [6, 7]]
7777
#### Python3
7878

7979
```python
80-
from sortedcontainers import SortedDict
81-
82-
8380
class SummaryRanges:
8481
def __init__(self):
8582
self.mp = SortedDict()

solution/0300-0399/0352.Data Stream as Disjoint Intervals/Solution.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedDict
2-
3-
41
class SummaryRanges:
52
def __init__(self):
63
self.mp = SortedDict()

solution/0300-0399/0363.Max Sum of Rectangle No Larger Than K/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ tags:
7676
#### Python3
7777

7878
```python
79-
from sortedcontainers import SortedSet
80-
81-
8279
class Solution:
8380
def maxSumSubmatrix(self, matrix: List[List[int]], k: int) -> int:
8481
m, n = len(matrix), len(matrix[0])

solution/0300-0399/0363.Max Sum of Rectangle No Larger Than K/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ The time complexity is $O(m^2 \times n \times \log n)$, and the space complexity
7373
#### Python3
7474

7575
```python
76-
from sortedcontainers import SortedSet
77-
78-
7976
class Solution:
8077
def maxSumSubmatrix(self, matrix: List[List[int]], k: int) -> int:
8178
m, n = len(matrix), len(matrix[0])

solution/0300-0399/0363.Max Sum of Rectangle No Larger Than K/Solution.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedSet
2-
3-
41
class Solution:
52
def maxSumSubmatrix(self, matrix: List[List[int]], k: int) -> int:
63
m, n = len(matrix), len(matrix[0])

solution/0400-0499/0480.Sliding Window Median/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,6 @@ func (h *hp) Pop() any {
466466
#### Python3
467467

468468
```python
469-
from sortedcontainers import SortedList
470-
471-
472469
class Solution:
473470
def medianSlidingWindow(self, nums: List[int], k: int) -> List[float]:
474471
l = SortedList()

solution/0400-0499/0480.Sliding Window Median/README_EN.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tags:
3636
<pre>
3737
<strong>Input:</strong> nums = [1,3,-1,-3,5,3,6,7], k = 3
3838
<strong>Output:</strong> [1.00000,-1.00000,-1.00000,3.00000,5.00000,6.00000]
39-
<strong>Explanation:</strong>
39+
<strong>Explanation:</strong>
4040
Window position Median
4141
--------------- -----
4242
[<strong>1 3 -1</strong>] -3 5 3 6 7 1
@@ -470,9 +470,6 @@ The time complexity is $O(n \log k)$, and the space complexity is $O(k)$. Here,
470470
#### Python3
471471

472472
```python
473-
from sortedcontainers import SortedList
474-
475-
476473
class Solution:
477474
def medianSlidingWindow(self, nums: List[int], k: int) -> List[float]:
478475
l = SortedList()

solution/0400-0499/0480.Sliding Window Median/Solution2.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedList
2-
3-
41
class Solution:
52
def medianSlidingWindow(self, nums: List[int], k: int) -> List[float]:
63
l = SortedList()

solution/0700-0799/0716.Max Stack/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ stk.top(); // 返回 5,[<strong>5</strong>] - 栈没有改变
9898
#### Python3
9999

100100
```python
101-
from sortedcontainers import SortedList
102-
103-
104101
class Node:
105102
def __init__(self, val=0):
106103
self.val = val

solution/0700-0799/0716.Max Stack/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ stk.top(); // return 5, [<strong><u>5</u></strong>] the stack did not change
8080
#### Python3
8181

8282
```python
83-
from sortedcontainers import SortedList
84-
85-
8683
class Node:
8784
def __init__(self, val=0):
8885
self.val = val

solution/0700-0799/0716.Max Stack/Solution.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedList
2-
3-
41
class Node:
52
def __init__(self, val=0):
63
self.val = val

solution/0700-0799/0729.My Calendar I/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ myCalendar.book(20, 30); // return True ,这个日程安排可以添加到日
7878
#### Python3
7979

8080
```python
81-
from sortedcontainers import SortedDict
82-
83-
8481
class MyCalendar:
8582

8683
def __init__(self):

solution/0700-0799/0729.My Calendar I/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ myCalendar.book(20, 30); // return True, The event can be booked, as the first e
7070
#### Python3
7171

7272
```python
73-
from sortedcontainers import SortedDict
74-
75-
7673
class MyCalendar:
7774

7875
def __init__(self):

solution/0700-0799/0729.My Calendar I/Solution.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedDict
2-
3-
41
class MyCalendar:
52
def __init__(self):
63
self.sd = SortedDict()

solution/0700-0799/0731.My Calendar II/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ myCalendarTwo.book(25, 55); // 返回 True,能够预定该日程,因为时
8181
#### Python3
8282

8383
```python
84-
from sortedcontainers import SortedDict
85-
86-
8784
class MyCalendarTwo:
8885

8986
def __init__(self):

solution/0700-0799/0731.My Calendar II/README_EN.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ tags:
4646

4747
<strong>Explanation</strong>
4848
MyCalendarTwo myCalendarTwo = new MyCalendarTwo();
49-
myCalendarTwo.book(10, 20); // return True, The event can be booked.
50-
myCalendarTwo.book(50, 60); // return True, The event can be booked.
51-
myCalendarTwo.book(10, 40); // return True, The event can be double booked.
49+
myCalendarTwo.book(10, 20); // return True, The event can be booked.
50+
myCalendarTwo.book(50, 60); // return True, The event can be booked.
51+
myCalendarTwo.book(10, 40); // return True, The event can be double booked.
5252
myCalendarTwo.book(5, 15); // return False, The event cannot be booked, because it would result in a triple booking.
5353
myCalendarTwo.book(5, 10); // return True, The event can be booked, as it does not use time 10 which is already double booked.
5454
myCalendarTwo.book(25, 55); // return True, The event can be booked, as the time in [25, 40) will be double booked with the third event, the time [40, 50) will be single booked, and the time [50, 55) will be double booked with the second event.
@@ -79,9 +79,6 @@ The time complexity is $O(n^2)$, and the space complexity is $O(n)$, where $n$ i
7979
#### Python3
8080

8181
```python
82-
from sortedcontainers import SortedDict
83-
84-
8582
class MyCalendarTwo:
8683

8784
def __init__(self):

solution/0700-0799/0731.My Calendar II/Solution.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedDict
2-
3-
41
class MyCalendarTwo:
52
def __init__(self):
63
self.sd = SortedDict()

solution/0800-0899/0846.Hand of Straights/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ function isNStraightHand(hand: number[], groupSize: number) {
213213
#### Python3
214214

215215
```python
216-
from sortedcontainers import SortedDict
217-
218-
219216
class Solution:
220217
def isNStraightHand(self, hand: List[int], groupSize: int) -> bool:
221218
if len(hand) % groupSize != 0:

solution/0800-0899/0846.Hand of Straights/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ function isNStraightHand(hand: number[], groupSize: number) {
198198
#### Python3
199199

200200
```python
201-
from sortedcontainers import SortedDict
202-
203-
204201
class Solution:
205202
def isNStraightHand(self, hand: List[int], groupSize: int) -> bool:
206203
if len(hand) % groupSize != 0:

solution/0800-0899/0846.Hand of Straights/Solution2.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedDict
2-
3-
41
class Solution:
52
def isNStraightHand(self, hand: List[int], groupSize: int) -> bool:
63
if len(hand) % groupSize != 0:

solution/0800-0899/0855.Exam Room/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ examRoom.seat(); // 返回 5,学生最后坐在 5 号座位。
8181
#### Python3
8282

8383
```python
84-
from sortedcontainers import SortedList
85-
86-
8784
class ExamRoom:
8885
def __init__(self, n: int):
8986
def dist(x):

solution/0800-0899/0855.Exam Room/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ The time complexity is $O(\log n)$, and the space complexity is $O(n)$. Here, $n
8181
#### Python3
8282

8383
```python
84-
from sortedcontainers import SortedList
85-
86-
8784
class ExamRoom:
8885
def __init__(self, n: int):
8986
def dist(x):

solution/0800-0899/0855.Exam Room/Solution.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from sortedcontainers import SortedList
2-
3-
41
class ExamRoom:
52
def __init__(self, n: int):
63
def dist(x):

solution/0900-0999/0975.Odd Even Jump/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ tags:
110110
#### Python3
111111

112112
```python
113-
from sortedcontainers import SortedDict
114-
115-
116113
class Solution:
117114
def oddEvenJumps(self, arr: List[int]) -> int:
118115
@cache

0 commit comments

Comments
 (0)