반응형
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")

def solution(A):
    # write your code in Python 3.6
    
    # step 1 - make a dictionary
    dict_= {}
    
    # step 2 - fill the dictionary
    for i in A:
        try: 
            dict_[i] += 1
        except: 
            dict_[i] =1
    
    # step 3 - find the odd value
    for i in dict_:
        if dict_[i] % 2 == 1:
            return i
    
    pass
반응형

'Codility' 카테고리의 다른 글

Codility - TapeEquilibrium  (0) 2020.04.13
Codility - PermMissingElem  (0) 2020.04.12
Codility - FrogJmp  (0) 2020.04.11
Codility - CyclicRotation  (0) 2020.04.09
Codility - Binary Gap  (0) 2020.04.08

+ Recent posts