Created
March 18, 2011 04:52
-
-
Save dmitric/875637 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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