Skip to content

Instantly share code, notes, and snippets.

@snivas
Created January 29, 2019 19:57
Show Gist options
  • Save snivas/f291b6e301457ef716ff674682df6762 to your computer and use it in GitHub Desktop.
Save snivas/f291b6e301457ef716ff674682df6762 to your computer and use it in GitHub Desktop.
Given an array of ints, return True if the sequence.. 1, 3, 4 .. appears in the array somewhere
def checkseq(nums):
desired = [1, 3, 4]
if str(desired)[1:-1] in str(nums):
return True
return False
list123([1, 1, 3, 4, 5])
#True
list123([1, 2, 4, 3, 5])
#False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment