Last active
December 17, 2020 04:41
-
-
Save hrubantjakub1/1cb20c0e8cf551a48a7c1c956c130fe5 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
// find element without pair in array | |
def solution(A): | |
A.sort() | |
for index in range(0,len(A),2): | |
if A[index] != A[index+1]: | |
return A[index] | |
B = [5,6,2,9,2,3,6,7,3,1,7,9,1] | |
print(solution(B)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you explain to me?