Skip to content

Commit e517d20

Browse files
committedAug 28, 2019
2019-08-27
1 parent 284ade9 commit e517d20

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

‎0251.展开二维向量/0251-展开二维向量.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,25 @@ def __init__(self, v):
55
:type v: List[List[int]]
66
"""
77
self.list = []
8-
for item in v:
9-
for num in item:
10-
self.list.append(num)
8+
for nums in v:
9+
for item in nums:
10+
self.list.append(item)
1111
self.index = 0
12-
12+
1313
def next(self):
1414
"""
1515
:rtype: int
1616
"""
1717
self.index += 1
18-
return self.list[self.index - 1]
18+
return self.list[self.index - 1]
19+
20+
1921

2022
def hasNext(self):
2123
"""
2224
:rtype: bool
2325
"""
24-
return self.index < len(self.list)
26+
return self.index != len(self.list)
2527

2628

2729
# Your Vector2D object will be instantiated and called as such:

0 commit comments

Comments
 (0)
Please sign in to comment.