Untitled

mail@pastecode.io avatar
unknown
python
19 days ago
220 B
2
Indexable
Never
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 False
Leave a Comment