Untitled
unknown
python
2 years ago
220 B
7
Indexable
def has22(nums):
prev_two = False
for idx, val in enumerate(nums):
if val == 2:
if prev_two:
return True
else:
prev_two = True
else:
prev_two = False
return FalseEditor is loading...
Leave a Comment