Created
August 26, 2016 21:29
-
-
Save henriquechehad/bae79083722be93903ac1bd243ae4b36 to your computer and use it in GitHub Desktop.
sublist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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