Skip to content

Commit

Permalink
2019-08-27
Browse files Browse the repository at this point in the history
  • Loading branch information
JiayangWu committed Aug 28, 2019
1 parent 284ade9 commit e517d20
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions 0251.展开二维向量/0251-展开二维向量.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ def __init__(self, v):
:type v: List[List[int]]
"""
self.list = []
for item in v:
for num in item:
self.list.append(num)
for nums in v:
for item in nums:
self.list.append(item)
self.index = 0

def next(self):
"""
:rtype: int
"""
self.index += 1
return self.list[self.index - 1]
return self.list[self.index - 1]



def hasNext(self):
"""
:rtype: bool
"""
return self.index < len(self.list)
return self.index != len(self.list)


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

0 comments on commit e517d20

Please sign in to comment.