Skip to content

Instantly share code, notes, and snippets.

@gbazilio
Created January 9, 2017 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbazilio/46be0790a014ca8cbc87a9e69a8a6b9e to your computer and use it in GitHub Desktop.
Save gbazilio/46be0790a014ca8cbc87a9e69a8a6b9e to your computer and use it in GitHub Desktop.
Codility - Permutation
def solution(A):
n = len(A)
A_sum = sum(set(A))
ideal_sum = n*(n+1)/2
return 1 if A_sum == ideal_sum else 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment