Skip to content

Instantly share code, notes, and snippets.

@nsfyn55
Last active August 29, 2015 14:01
Show Gist options
  • Save nsfyn55/607229f64f16c042693a to your computer and use it in GitHub Desktop.
Save nsfyn55/607229f64f16c042693a to your computer and use it in GitHub Desktop.
Find curved numbers interview question
s = set(['0','2','3','5','6','8','9'])
l = ['33', '14', '19']
# as loop
for num in l:
charset = set(num)
if charset.intersection(s):
print num
# as comprehension
result = [num for num in l if set(num).intersection(s)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment