Created
September 1, 2015 19:48
-
-
Save 43061b4a/de5416f763b1c4b47e95 to your computer and use it in GitHub Desktop.
This file contains 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): | |
d = {} | |
result = 0 | |
for i in range(len(A)): | |
if A[i] not in d and A[i] >= 1: | |
d[A[i]] = 0 | |
j = 1 | |
while j <= 100010: | |
if not j in d: | |
result = j | |
break | |
j += 1 | |
return result | |
#https://codility.com/demo/results/demoMC99B7-2H5/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment