Lonely Integer

  • + 0 comments
    def lonelyinteger(a):
        dict_occ = {}
        for num in a:
            dict_occ[num] = 0
            for n in a:
                if num == n:
                    dict_occ[num] += 1
        for key, val in dict_occ.items():
            if val == 1:
                return key