Skip to content

Instantly share code, notes, and snippets.

@gbazilio
Created January 8, 2017 14:28
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/f66a18ad3239bb0a48e68cad407f8a26 to your computer and use it in GitHub Desktop.
Save gbazilio/f66a18ad3239bb0a48e68cad407f8a26 to your computer and use it in GitHub Desktop.
Codility - Missing element
def solution(A):
A_length = len(A)
array_sum = sum(A)
complete_sequence_sum = (A_length * (A_length + 1) / 2) + (A_length + 1)
return complete_sequence_sum - array_sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment