We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 284ade9 commit e517d20Copy full SHA for e517d20
0251.展开二维向量/0251-展开二维向量.py
@@ -5,23 +5,25 @@ def __init__(self, v):
5
:type v: List[List[int]]
6
"""
7
self.list = []
8
- for item in v:
9
- for num in item:
10
- self.list.append(num)
+ for nums in v:
+ for item in nums:
+ self.list.append(item)
11
self.index = 0
12
-
+
13
def next(self):
14
15
:rtype: int
16
17
self.index += 1
18
- return self.list[self.index - 1]
+ return self.list[self.index - 1]
19
20
21
22
def hasNext(self):
23
24
:rtype: bool
25
- return self.index < len(self.list)
26
+ return self.index != len(self.list)
27
28
29
# Your Vector2D object will be instantiated and called as such:
0 commit comments