Skip to content

Instantly share code, notes, and snippets.

@dmitric
Created March 18, 2011 04:52
Show Gist options
  • Save dmitric/875637 to your computer and use it in GitHub Desktop.
Save dmitric/875637 to your computer and use it in GitHub Desktop.
def find_missing(n,missing_some):
check = [k+1 for k in xrange(n)]
for i in missing_some:
if i in check:
check.remove(i)
return check
def find_missing_using_sets(n,missing_some):
x = frozenset(frozenset([i for i in xrange(1,n+1)])-frozenset(missing_some))
return [i for i in x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment