Created
March 24, 2017 00:16
-
-
Save divmgl/4832fd5250fb3e353600caab92aa098a to your computer and use it in GitHub Desktop.
Codility.com PermMissingElem 100%/100%
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 solution(A): | |
total = sum(A) | |
diff = sum(range(1, len(A) + 2)) | |
return abs(diff - total) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment