Skip to content

Instantly share code, notes, and snippets.

@henriquechehad
Created August 26, 2016 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henriquechehad/bae79083722be93903ac1bd243ae4b36 to your computer and use it in GitHub Desktop.
Save henriquechehad/bae79083722be93903ac1bd243ae4b36 to your computer and use it in GitHub Desktop.
sublist
array_a = [2, 31, 14, 53, 1, 214, 21, 2, 3, 5, 6, 1, 3, 4, 2, 1, 2, 4]
array_b = [1, 3, 4]
def check_sublist(a, b):
return ','.join(map(str, b)) in ','.join(map(str, a))
check_sublist(array_a, array_b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment