Skip to content

Instantly share code, notes, and snippets.

@43061b4a
Created September 1, 2015 19:13
Show Gist options
  • Save 43061b4a/df98f251e9c6dadaa7ba to your computer and use it in GitHub Desktop.
Save 43061b4a/df98f251e9c6dadaa7ba to your computer and use it in GitHub Desktop.
# you can use print for debugging purposes, e.g.
# print "this is a debug message"
def solution(A):
d = dict(zip(range(1, len(A) + 1), [0] * (len(A) + 1) ))
result = 0
for i in A:
if i in d:
d.pop(i)
if not d:
result = 1
break
return result
# https://codility.com/demo/results/demoGAFAKK-GX8/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment