93일차 - Find the stray number

--------------------------------------------🤞 My Solution -----------------------------------------

def stray(arr):
    temp = []
    result = 0
    for i in range(0, len(arr)):
        x = i
        try:
            if arr[i] != arr[i+1]:
                temp.append(arr[i])
                temp.append(arr[i+1])
        except:
            pass
    for i in temp:
        if arr.count(i) == 1:
            result = i
    return result

좋은 웹페이지 즐겨찾기