Skip to content

Instantly share code, notes, and snippets.

@walteraa
Created January 29, 2019 17:14
Show Gist options
  • Save walteraa/78173281f8cc74124144fee3542f485d to your computer and use it in GitHub Desktop.
Save walteraa/78173281f8cc74124144fee3542f485d to your computer and use it in GitHub Desktop.
Hotjar
def solve(input_list,to_find_list):
if len(input_list) < len(to_find_list):
return False
i = 0
to_find_size = len(to_find_list)
while (i + to_find_size) <= len(input_list):
if input_list[i:i+to_find_size] == to_find_list:
return True
i += 1
return False
l = [1,2,1,2,1,3,4]
m = [1,3,4]
assert solve(l,m)
m = [2,5,6]
assert not solve(l,m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment